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

Building strings for arrays

I don't know about you, but I hate building strings for arrays. That's where you have to wrap each string in double quotes and delimit with a comma, like this:

From

"Once upon a time"

to

"Once","upon","a","time"

Invariably, I make a mistake in typing (stupid fingers!) and have to correct it. So I came up with a way to generate it automatically. Enter the QuoteString function!

Continue Reading: Building strings for arrays »

VBA icon

Building a string from an array

I'm sure this has been done before. But I couldn't find any code samples (really!), so I wrote my own.

Here's how I build a string (for message boxes and such) from the contents of an array.

Continue Reading: Building a string from an array »

Site last updated: February 8, 2012