Link to home
Start Free TrialLog in
Avatar of kevman123
kevman123

asked on

Use a variable to identify a variable

Is there a way to use a variable to identify a variable-- for example:

Value1ID as integer
Value2ID as integer
Value3ID as integer

For x=1 to 3
    Value & x & ID = 123*x
Next x
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

use an array:

Dim ValueID(3) as Integer

For x=1 to 3
    ValueID(x) = 123*x
Next x


AW
Avatar of bkthompson2112
bkthompson2112

Hi kevman123,

Use an array:

Dim ValueID(3) as Integer

For x = 1 to 3
  ValueID(x-1) = 123*x
Next x

bkt
Gah!  Sorry AW.
Too slow.
Avatar of kevman123

ASKER

That's the problem, it is already an array- sorry I forgot to put that-

Value1ID(3) as integer
Value2ID(3) as integer
Value3ID(3) as integer

For x=1 to 3
    Value & x & ID(x) = 123*x
Next x
ASKER CERTIFIED SOLUTION
Avatar of bkthompson2112
bkthompson2112

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I guess I could use a 2 dimensional array- however, I would like to know if my original question is possible, not just a workaround.
We're on the same wavelength!
Using arrays is the only way I know of doing that in VB.
Ok- I'll hold out for a little bit and see if anyone has an answer for it- otherwise I'll just give you the points since you gave the most feedback-
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I believe a split is in order here- thanks for the quick responses guys!
Well, I should have reversed the assisted and accepted answers- anyhow- thanks again-
as long as the points were assigned the same, Accepted and Assisted are irrrelevant.  And as for the points, with just 9,900,000 more, I can get a Tall Mocha Latte at Starbucks for only $4.50  LOL.

AW
AW, agreed.

>ust 9,900,000 more...   ROFL