Syntax to extract individual characters from VBA string

Probably an easy question, but how do I reference the individual characters of a string?  For example in order to extract each character one after another I thought it would be something like this:

Dim MyString As String
Dim MyChar As String

MyString = "abcd"

For index = 0 to Len MyString
    MyChar = MyString[index]   'this syntax is incorrect
Next index


Thanks.
JohnSantaFeAsked:
Who is Participating?
 
Patrick MatthewsConnect With a Mentor Commented:
For index = 1 to Len(MyString)
    MyChar = Mid(MyString, index, 1)   'this syntax is incorrect
Next index
0
 
Patrick MatthewsCommented:
MyChar = Mid(MySTring, index, 1)
0
 
JohnSantaFeAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.