Back to index

How to Install VBA Code

With your Excel workbook open, press ALT-F11. This will open a new window, the VBA Development window. Here is what you will see:

VBA Development Window

In this example the workbook is called "VBA Sample.xlsx" and can be seen at the bottom of the tree. It has one worksheet called Sheet1. There are two code modules, one for the workbook and one for the worksheet. If you double-click on Sheet1, you will see the corresponding code window on the right side, as shown.

To install code that is specific to the worksheet or the workbook, simply paste it into the corresponding code window.

You will notice that there is already one line of code in the window, even though this is a new workbook that was just created. What is that?