A string is an array of bytes, and you can iterate through it if you know your way around two-byte implementations of a string (or Unicode, which is usually 2 bytes per character, but can be more: and it's always going to be 2-Byte if your string originated in VBA).
When I say is, I mean it: there is no need for a type conversion, and this will work just fine:
Public Sub TestByteString()
Dim strChars As String
Dim arrBytes() As Byte
Dim i As Integer
strChars = "The quick Brown Fox"
arrBytes = strChars
Debug.Print strChars
Debug.Print
For i = LBound(arrBytes) To UBound(arrBytes) Step 2
Debug.Print Chr(arrBytes(i)) & vbTab & "Byte " & i & " = " & arrBytes(i)
Next i
arrBytes(0) = Asc("?")
arrBytes(2) = Asc("!")
arrBytes(4) = Asc("*")
strChars = arrBytes
Debug.Print
Debug.Print strChars
Erase arrBytes
End Sub
Your outputs will look like this:
The quick Brown Fox
T Byte 0 = 84
h Byte 2 = 104
e Byte 4 = 101
Byte 6 = 32
q Byte 8 = 113
u Byte 10 = 117
i Byte 12 = 105
c Byte 14 = 99
k Byte 16 = 107
Byte 18 = 32
B Byte 20 = 66
r Byte 22 = 114
o Byte 24 = 111
w Byte 26 = 119
n Byte 28 = 110
Byte 30 = 32
F Byte 32 = 70
o Byte 34 = 111
x Byte 36 = 120
?!* quick Brown Fox
Note the 'Step 2' in the loop: I'm discarding every other byte, because I know that it's plain-vanilla Latin characters - 'ASCII' text to the uninitiated.
It gets interesting when you have to deal with Arabic and Pinyin text: and you should never assume in a real-world worksheet that you're always going to be dealing with plain-vanilla US ASCII, as I did in that demonstration piece.
For a more comprehensive example, with more detailed explanation, try this from Excellerando:
Writing an Excel range to a csv file: optimisations and unicode compatibility
The Byte-array optimisation is towards the bottom, under this heading:
A VBA implementation of the Adler-32 checksum, running on byte arrays instead of using VBA string-handling.
The underlying nature of a string does not seem to be as widely-known as it should be: it's not a thing that you will use often in your code, but a lot of the problems with Unicode and non-Latin alphabets that people have get easier when they have a deeper understanding of the variables in their code.
UBound(s)fail on string variablessandLen(b)fail onbyte()variablesb? Obviously the underlying representation of a string is an array of bytes (what else could it be -- a linked list?) and your answer shows how this can be exploited, but the VBA compiler itself makes semantic distinctions between strings and byte arrays, so it isn't clear why you should in effect scold others for making such distinctions.