VBA Use the LenB function to determine the number of bytes in a string


Example

Const baseString As String = "Hello World"

Dim byteLength As Long

byteLength = LenB(baseString)
'byteLength = 22