Thursday, January 25, 2007

VBA, a bit of recognition

First, let me state that I don't like VBA. This is Excel's macro language which back in the '90s wasn't that bad, but since that time I've learned a lot about various programming languages. VBA is weak, at best. It's just powerful enough to barely get your work done, but it's powerful enough to screw things up too. I'm not just griping, but do have a point here.

I write Excel macros about 3-4 times a year. But when I do, it's always a challenge. These usually aren't trivial things -- they construct pricing tables or analyze time sheets usually doing some tough things. One macro I wrote recently was easily over 100 lines. But as I've mentioned, I'm no VBA expert. So I spend a lot of time in the Help windows. But Microsoft, in their wisdom, usually write documentation just for the API, assuming you already know how the function works internally. It's a help in that you can find various functions that are there, but not great for branching out and pushing the edges.

Enter the Internets. Usually a quick Google lands me several tutorial examples or code bits already written. Here is one example I just used to test for all-numeric or all-text strings. I could have written this myself of course, but a search and copy & paste was much, much quicker.

So to all you VBA guys and gals out there that write this stuff daily and are kind enough to post code snippets: Thank You!

No comments: