用StrConv函数进行转换
Dim mByte() As Byte '字节数组
Dim str As String '字符串
Dim i As Long
str = "01010101"
'字符串->字节数组
mByte = StrConv(str, vbFromUnicode)
For i = 0 To UBound(mByte)
Debug.Print mByte(i)
Next
'字节数组->字符串
str = StrConv(mByte, VBUnicode)
Debug.Print str