View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] reinquisito2@gmail.com is offline
external usenet poster
 
Posts: 3
Default Sequential variables (no array)

Il giorno lunedì 31 luglio 2017 12:55:06 UTC+2, Auric__ ha scritto:
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.


Ok Auric,
I rewrite code using array.
Thanks
BR