|
|
|
|
Getting StartedWriting VBA code for Excel is easy and fun!! Once you learn a few basics, you will be creating highly professional spreadsheets. VBA allows you to design a spreadsheet that will do things that are impossible with the basic spreadsheet options. It also allows you to make your spreadsheets more user-friendly. The Visual Basic ToolbarThe first step in adding Visual Basic to your spreadsheet is to turn on the VB Toolbar. To turn on the toolbar, select the View menu, click on the Toolbars command, and turn on the Visual Basic option. The following toolbar will appear:
The options in the toolbar are as follows:
Design ModeWhen you are writing VB code and adding controls to a spreadsheet, there are two basic modes: Design mode and Run mode. In design mode, when you click on a button or a control, you can edit the properties of the control in the VB Editor. If you double click on a control, you can edit the code associated with the control. If you are in Run mode, when you click on the control, the code associated with the control is executed. When developing your spreadsheet, you will be moving in and out of Design mode. The VB EditorThe VB Editor is where you edit the Visual Basic code. It is very similar to the regular Visual Basic compiler. The code is shown in a set of windows on the right. The Project window on the left lists the components of the project. The Microsoft Excel Objects folder lists each of the sheets in your spreadsheet and the workbook. The Modules folder lists the code associated with Macros. |