wsnyder
Board Regular
- Joined
- Sep 23, 2018
- Messages
- 224
- Office Version
- 365
- Platform
- Windows
Hi,
Using Excel 365.
How do I evaluate a variable at run-time?
The code below is returning sp1, sp2, sp3
I am trying to evaluate the variable as Alpha, Bravo, Charlie,
Thanks
-w
Using Excel 365.
How do I evaluate a variable at run-time?
The code below is returning sp1, sp2, sp3
I am trying to evaluate the variable as Alpha, Bravo, Charlie,
Thanks
-w
VBA Code:
Sub foo2()
Const sp1 As String = "Alpha"
Const sp2 As String = "Bravo"
Const sp3 As String = "Charlie"
Const myv As String = "sp"
Dim v As Variant
Dim s As String
Dim i As Long
For i = 1 To 3
s = myv & i
Evaluate (s)
Debug.Print s
Next i
End Sub