VBA Len function

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)

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