Adding numbers

Results 1 to 2 of 2

Thread: Adding numbers

  1. #1
    Join Date
    Dec 1969

    Default Adding numbers

    Hi-<BR><BR>I have something like the following...<BR><BR>Dim Variable, Number, NumberMuncher, i, AddedNumbers<BR>Variable = 1,2,3,4,5:Name,Number,Other,values,in,var<BR>Numbe r = Split(Variable, ":")<BR>NumberMuncher = Split(Number(0), ",")<BR>For i = 0 To UBound(NumberMuncher)<BR>AddedNumbers = AddedNumbers + NumberMuncher(i)<BR>Next<BR><BR>What I want is 15,<BR>But I get 12345<BR><BR>I know that it thinks the variables contain text, but how do I tell it that it contains numbers as well.<BR>Thanks,<BR>Jeremy#121

  2. #2
    Join Date
    Dec 1969

    Default RE: Adding numbers

    first off, put quotes around the variable &#039;variable&#039;... and use the handy dandy &#039;cint()&#039; function like below......<BR><BR> addednumbers = addednumber + cint(numbermuncher(a))<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts