I just started my second week at a new job (yes, things have been a bit quiet around here as I’ve been adapting), and the strangest thing has been happening. It’s really a very good thing that I don’t have Excel at home, because I don’t want to stop working at the end of the day. Weird, I know.
What’s going on? I’m coding again. I’m coding for the first time since that Pascal class in college that assumed I had a whole bunch of background knowledge on the structure of programming languages that I didn’t have. Let me just say that any programming course–with no prerequisites–that takes a student who was doing side projects in high school Basic and leaves them wondering what everyone is talking about is poorly designed.
Luckily, programming classes have mostly improved since then. So has my knowledge of programming language structures. I didn’t study it in between. I’ve just been in the middle of enough discussions about bad code to figure out what kind of mistakes people can make. Knowing what can go wrong is a great way of understanding how things should go right.
Still, I was a little worried. I expected more headaches as I moved from heavy Excel use, only sometimes adapting existing macros for my needs, to creating macros from scratch in VBA as a way to automate processes for my new company.
As it turns out, knowing how to manipulate just about any kind of data in Excel means I already create data algorithms that work in VBA. Having picked up programming language structures by osmosis means I know what sorts of commands I’m looking for when I want to translate those algorithms into code. Plus I know most of the “shortcuts” VBA takes by using Excel’s built-in abilities.
On my third day, I solved a problem that had been stumping the local “VBA guru”. Now, I’m not going to tell you it was because I’m already that good at VBA. In fact, I learned a lot looking at his code, turned around and immediately changed something I had just written to use his more elegant, faster method.
I do, however, know dates. I know how to add, compare, increment, and round them in just about any way imaginable, because someone has not only imagined it, but used it to hang decisions on. Then I had to make sure a spreadsheet could handle the calculation. It turns out that this knowledge is critical to getting macros to handle dates properly.
Now, two business days later, I want to go back and streamline that macro, though. There’s duplication that’s just begging for mistakes if have to edit it again. Also, I want to play more with calling subs. Still, learning about proper error handling comes first. Userforms aren’t much good if they can’t recover from someone entering the wrong kind of data.
Have I mentioned that my dialog boxes are pretty? None of that off-center, non-aligned crap for me. Also, I’ve been doing this for a week, and I’m prompting for user-defined variables. My code is properly indented and thoroughly commented too.
I’m not gloating, really. I’m just tickled to have my skills and experience come together in a way that’s as useful as this is. I’m thrilled to have the framework on which to hang so much new knowledge so quickly. And it’s so, so nice to be coding again. It’s nice to have it verified that I hit bad pedagogy in college, not a wall.
But that’s enough of that. Time to go crash so I can do more, more, more of this tomorrow. We’ll see how long VBA manages to satisfy me.