The max number of characters you can use in string in a vba function is 255. I am trying to run this function
Var1= 1
Var2= 2
.
.
.
Var256 =256
RunMacros=
This test shows that the string in VBA can be at least 10^8 characters long. But if you change it to 10^9 you will fail.
Sub TestForStringLengthVBA()
Dim text As String
text = Space(10 ^ 8) & "Hello world"
Debug.Print Len(text)
text = Right(text, 5)
Debug.Print text
End Sub
So do not be mislead by Intermediate window editor or MsgBox output.