Accessing a variable name by a variable
I know you can call a function by name or by it's name in a variable. My question is can that also be done for named variables or Const's?
To illustrate
I have the following data strings in my code:
Private Const s1 = "some text here"
Private Const s2 = "some text here"
Private Const s3 = "some text here"
Private Const s4 = "some text here"
etc
etc
Private Const s356 = "some text here"
I cannot put the data in an array. That is out of the question. I can only put the data in a series of Const's like shown above.
I need some way, if possible, to access the data from each Const without having to explicitly namming each Const. Something like this
For q = 1 to 356
MyDataString = MyDataString & "s" & q
Next q
Now I know the above will put "s1", "s2", "s3",...."s356" in MyDataString but I need the actual data from these Const's.
Re: Accessing a variable name by a variable
No you cannot. Why is an array out of the question?????
Re: Accessing a variable name by a variable
It isn't anymore. I thought perhaps I wouldn't be able to use one but I did figure out how to go about my problem using an array.