VBA Len function

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Len Function Description

The VBA Len function returns the character length of a specified string.


The syntax for the Len function in VBA is:

Len( text )


The string for which the character length is to be returned for.

Example usage

The Len function can be used in VBA code. Let’s look at some VBA Len function examples:

Len "Hello"
'Result: 5

Len "Hi There!"
'Result: 9

Len ""
'Result: 0

Simply the best place to learn VBA!

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match