Access the Visual Basic editor using any of the following methods:
1. Press Alt+F11
2. Click Tools in the menu, Macro from the drop-down menu and VB Editor
3. Right click on any toolbar, select the VB toolbar and click the VB
editor button
Once you're in the editor click Insert and select module, and this is where
you would enter in any code.
FYI: In my prior post I neglected to copy the End Sub line, which should be
the last line in the macro.
You can copy the code out of the post and substitute the correct paths and
filename if you want to test drive the code. To execute the code from the
Editor press F5, or to run the code 1 line at a time press F8, once for each
line of code in the sub.