Karen has attended:
Excel VBA Intro Intermediate course
Excel VBA
How can I generate the next number in a list of consecutive numbers ?
RE: Excel VBA
Hi Karen
A simple way to generate consecutive numbers is by using a Variable and some form of loop. For example:
Dim Counter as Integer
For Counter = 1 To 500
<Do your thing using the Counter in the code>
Next Counter
Alternatively you could use an accumulator on the Variable
Dim MyNumber as Integer
MyNumber = 1
MyNumber = MyNumber +1
This line of code would be placed in the sequence where the next consecutive number was required
Hope this helps
Carlos