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 »

VBA icon

Creating subdirectories in VBA when parent folder doesn't exist

Ben writes in and asks about saving Outlook emails into hard drive folders and then deleting them. He sent in a routine found on VBA Express, but it causes an error when creating directories. The problem is that if you select anything other than a top-level folder (i.e. a subfolder), it tries to create full paths (that didn't previously exist) instead of just single subdirectories under existing directories.

Continue Reading »

excel school learn dashboards