Again, resist the temptation to close the toolbar.This does not stop the recording. If you do accidentally close the toolbar,you can stop recording by choosing Tools, Macro, Stop Recording from the main menu.

It is time to take a look at your code. Switch to the Visual Basic Editor by choosing Tools, Macro,Visual Basic Editor or pressing Alt+FII.

Examining Code in the Programming Window

Let's take a look at the code you just recorded from the case study; don't worry if it doesn't make sense yet.

To open the Visual Basic Editor press Alt+F11. In our VBA Project (MacroToImportInvoices.xls), find the component Module1, right-click on it, and select View Code. Notice that some lines start with an apostrophe—these are comments and are ignored by the program. The macro recorder starts your macros with a few comments, using the description that you entered in the Record Macro dialog. The comment for the Keyboard Shortcut is there to remind you of the shortcut.

0 0

Post a comment