I'm wondering if it is possible to set a Variable as a Variable.
For example...
A set of variables all starting with the same name that are appended with numbers. such as Var1, Var2, Var3, etc.
I want to run a loop that goes through this list of variables by using a count, so that I do not have to type out every variable in the list.
Such that...
Count = 1 // yields Var1
Count = 2 // yields Var2
Count = 3 // yields Var3
Then when the count is equal to 1, the variable pulls from Var1
And when the count is equal to 2, the variable pulls from Var2
And etc...
I have tried building it like this...
Dim Variable As String
Variable = "[Var" & [Count] & "]"
But it only returns a string like "[Var1]" not what Var1 is set as
This would be helpful to cut down on typing static code and to make the code as dynamic as possible to allow for adaptations.
Any ideas?
For example...
A set of variables all starting with the same name that are appended with numbers. such as Var1, Var2, Var3, etc.
I want to run a loop that goes through this list of variables by using a count, so that I do not have to type out every variable in the list.
Such that...
Count = 1 // yields Var1
Count = 2 // yields Var2
Count = 3 // yields Var3
Then when the count is equal to 1, the variable pulls from Var1
And when the count is equal to 2, the variable pulls from Var2
And etc...
I have tried building it like this...
Dim Variable As String
Variable = "[Var" & [Count] & "]"
But it only returns a string like "[Var1]" not what Var1 is set as
This would be helpful to cut down on typing static code and to make the code as dynamic as possible to allow for adaptations.
Any ideas?