View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Auric__ Auric__ is offline
external usenet poster
 
Posts: 538
Default Sequential variables (no array)

reinquisito2 wrote:

is possible in the code using a for next for assign a value to a sequential
variables (no array)?

I mean, instead of this...

aa1 = 9
aa2 = 9
aa3 = 9
......
aa100 = 9

use:

for x = 1 to 100
aa&"x" = 9 -- I do not know the correct syntax !!!
next x

No array aa(x) please.


Why not? This is one of the reasons arrays exist.

There is nothing built into VBA that will let you do as you ask. You could
probably do this using, say, self-modifying code, but that opens a whole new
can of worms, and is definitely not for beginners.

What *exactly* are you trying to accomplish? *Why* don't you want to use an
array?

--
- I'm going to free them.
- Why?
- Because it's the right thing to do, you narrow-minded jackass.