Jaafar Tribak
Well-known Member
- Joined
- Dec 5, 2002
- Messages
- 9,797
- Office Version
- 2016
- Platform
- Windows
Hi dear forum members.
Consider the following:
Of course, the above code won't work but you get the idea ... What I am looking for is to be able to populate the array MyArray with the 4 letters A,B,C,D based on the Const MyConst just like you woud using the following:
I have tried a few string manipulations/Evaluate etc ... but with no sucess... Does anybody have an idea how/if this could be done ?
Thank you.
Consider the following:
Code:
Const MyConst = "A" & "B" & "C" & "D"
Sub Test()
Dim Myarray() As Variant
Myarray = Array(MyConst)
Debug.Print Myarray(0); Myarray(1); Myarray(2); Myarray(3)
End Sub
Of course, the above code won't work but you get the idea ... What I am looking for is to be able to populate the array MyArray with the 4 letters A,B,C,D based on the Const MyConst just like you woud using the following:
Code:
Myarray = Array("A", "B", "C", "D")
I have tried a few string manipulations/Evaluate etc ... but with no sucess... Does anybody have an idea how/if this could be done ?
Thank you.
Last edited: