devxlogo

Determining Variable Length

Determining Variable Length

Question:
How do I test the number of ‘characters’ contained within a given variable?

Answer:
Try this:

Debug.Print "Length: " & Len(CStr(X))

Once you convert a variable to a string, you can use the Len function on it to determine how many characters are in it.

devx-admin

Share the Post: