VBA icon

Len vs Empty, which is faster

In Is That String Really Empty? I mentioned that Empty returns the same response as Len when checking variable- and fixed-length strings. Let's test which one is faster.

Continue Reading: Len vs Empty, which is faster »

VBA icon

Is That String Really Empty?

ball of string

While testing out some operations on a Variant, I ran across an interesting problem. One of the variables I used was a fixed-length string.

Turns out, this type of variable fails the Len test: it returns the predetermined length of the variable even if you don't set it to any value! I recognize, however, that this may be only a minor problem. Who uses fixed-length string variables that often anyway?

Continue Reading: Is That String Really Empty? »

VBA icon

Len or LenB, which is faster?

Hope you had a fun New Year holiday!

Continuing with the series of tests I've been posting, another function I found is LenB. I don't know much about it, but it supposedly returns the length of a string, the same as Len.

Continue Reading: Len or LenB, which is faster? »

VBA icon

Len vs blank strings vs vbNullString

In Len or Loop we looked at two different methods for checking the length of a string, to determine which is faster. Using logic we can use the length of a string to determine if a string is empty.

Continue Reading: Len vs blank strings vs vbNullString »

VBA icon

Len or Loop

question image

So I decided to test another assumption of mine: that Len is the fastest method for checking the length of a string, and therefore if a string variable is empty. The next series of posts will explore that in more detail.

Continue Reading: Len or Loop »

Site last updated: February 22, 2012