string function in vba code example
Example: vba string
Dim text1 As String
text1 = "Hello"
text1 = text1 & " World"
Debug.Print Left(text1, 3) ' Hel
Debug.Print Right(text1, 4) ' orld
Debug.Print Mid(text1, 2, 3) ' ell
Debug.Print Len(text1) ' 11 (size)
Debug.Print Instr(text1, "World") ' 6 (position in text1)