- A VBA project is created within Excel itself by clicking "Visual Basic Editor." The Visual Basic Editor has three windows: project, properties and code. The Project windows shows information about the Excel spreadsheet. The properties show the features of the spreadsheet -- for example, how many worksheets it contains. The code window lets you input the code that makes the spreadsheet commands run automatically.
- Clicking on the code window enables you to enter the actual VBA code. An example of this might be to add the contents of one cell to another. By typing "=sum(A1+B1)" into the code window and then clicking the "Run" button, the command will be processed automatically.
- Once the project is created and code is added to it, the VBA project should be saved. Clicking "File," then "Save" does this.
- When you need to run the VBA project, click "Macros" from within the "Tools" menu and select the project you created. The macro runs, and the instructions are processed.
Creating a New VBA project in Excel
Adding Code to the VBA project
Saving the VBA project
Using the VBA project
SHARE