Fridays are tip days at SimpleProductivity blog.
There are a lot of things that I do repeatedly on my computer. From text that gets typed over and over, to more complex actions that get performed daily or weekly.
Both Word and Excel come with a facility to automate these repetitive actions. These are called Macros, and you can program them using a subset of Visual Basic, called Visual Basic for Applications. (VBA)
I am fluent in Visual Basic, but VBA is only distantly related. The programming commands contained in each application are geared for those applications. The documentation is sparse, and guessing the syntax can be difficult. And if you’re not a programmer, it can be a daunting task!
The Macro Recorder
There is an easy way out, though. Both Word and Excel 2003 include a facility to record macros. What this means is you click a button, and it records all your mouse clicks and key pushes until you turn the recorder off. Here is the best part: you can look at the VBA code that the macro recorder produces.
Most people try to use the recorder to capture the entire long sequence of what they are trying to do, only to find themselves re-recording to fix typos or pick up lost steps.
How To Program Using the Macro Recorder
The easiest way to put together VBA code is to record little bits of what you want to do, then paste everything together into one Macro. Instead of trying to get everything, record bits and pieces. Then you can go into the code and put it all together.
By approaching Macros this way, you will save yourself time and trouble. You may also find yourself creating a little library of bits of recorded actions that you can use again and again.
Photo by tripleascholar