To get the length of a string you use the Len function. The Len Function uses the following syntax:
Len(String)
The following code gets the text from Text1 and tells you how many characters are in it (its length)
' Declare variable
Dim lLength As Long
' Get the length of the text
lLength = Len(Text1.Text)
' Display a Message Box
Msgbox "Text1 has " & lLength & " characters in it"
Comments