vba - How to define variables based on value of another variable -


i new forum, please pardon me if not accustomed procedures.

my question follows:

suppose running loop in vba = 1 10 want define variables based on number of loops.

that is, if there 10 loops there 10 variables created x1, x2,...., x10 if there 20 loops, there 20 variables created x1, x2, ....., x20.

i pretty new vba , not have idea.

any appreciated.

thanks lot

if aware of how many loops have, use info define array of variables.

for example:

dim numbers(1 10) long 'declare upper/lower bounds dim morenumbers(20) long 'default starts 0 lower bound 

now if want declare values through loop, easy. let's want array of 10 strings, foo1-foo10:

dim arrayoffoo(1 10) string  = 1 10     arrayoffoo(i) = "foo" & next 

hope helps.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -