craig.penny
Well-known Member
- Joined
- May 8, 2009
- Messages
- 656
This might be a ridiculous want but I'll ask anyway. I'd like to be able to create a number of variables based on user input. Something like this:
'-------------------------
Dim Counter as long
Dim X as long
X = inputbox(prompt:="Enter Number of Blah Blah")
For Counter = 1 to X
Dim VarCounter as Double 'I want it to be Var1, Var2, ...
Next X
'-------------------------
The reason behind this is that I'm trying to find a work around to the limitation of only being able to change the last dimension of an array with ReDim. I feel like there is some way I could do this with a CallByName but if it's possible then I'm not getting the syntax right.
Thanks in advance for any guidance!
'-------------------------
Dim Counter as long
Dim X as long
X = inputbox(prompt:="Enter Number of Blah Blah")
For Counter = 1 to X
Dim VarCounter as Double 'I want it to be Var1, Var2, ...
Next X
'-------------------------
The reason behind this is that I'm trying to find a work around to the limitation of only being able to change the last dimension of an array with ReDim. I feel like there is some way I could do this with a CallByName but if it's possible then I'm not getting the syntax right.
Thanks in advance for any guidance!