• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Loading array with string constant

polarisking

Member
I'm trying to load a 6 element array with 6 defined string constants

The "arr =" statement is failing on "Syntax Error". Any ideas?

Code:
Dim arr  As Variant
  
Const varA  As String = "A"
Const varB  As String = "B"
Const varC  As String = "C"
Const varD  As String = "D"
Const varE  As String = "E"
Const varF  As String = "F"
 
arr = (varA,varB,varC,varD,varE,varF)
 
Once again, you've delivered the solution. Thank you so much.

Note: I fully understand the 0 offset, but for ease of understanding for those coming after me who might have to debug or amend the macro, I always insert Option Base 1 so the array begins at 1.
 
Back
Top