How to Concatenate a variable name in a vba loop ?

  • Thread starter Thread starter tmb
  • Start date Start date
T

tmb

Const Value1 as long = 5
Const Value2 as long = 12
Const Value3 as long = 7

For i = 1 to 3
MsgBox Value & i '<-- How to do this properly?
Next i

I want MsgBox to display 5 then 12 then 7
I can't figgure out how to get Value and i to combine properly to do this.

thanks for any help.

PS - This is a repost as I didn't ask the question correctly last time.
 
But you are happy with the last answer you got?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
I am happy Bob.

thanks for the help.

Bob Phillips said:
But you are happy with the last answer you got?

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
That's okay, just checking as the times seemed to suggest this came after
the last posting.

Regards

Bob
 
Back
Top