Datasheet

19
Chapter 1: Using Macros and Form Controls
4
2
3
There are two ways to create a macro. One way is to use the macro recorder to record the steps needed to perform
the action. The other way is to create the steps by typing the Visual Basic for Applications (VBA) code into the Code
window of the Visual Basic Editor (VBE). When you use the macro recorder, Excel automatically creates the VBA
code for you. You can use the VBE to edit macros you have created with the macro recorder. Often, it is convenient
to use a combination of the two methods to create your VBA code: You record part of the VBA code, and then you
use the VBE to augment or modify your code.
To activate the VBE, you can press Alt+F11 while in Excel or click the Visual Basic button on the Developer tab. If
you create your macros using the macro recorder, Excel defines each macro you create as a procedure and stores
each procedure in a module. The VBE lists modules in the Project Explorer under the workbook in which they are
located.
A message box appears, asking you
to confirm you want to delete the
macro.
4 Click Yes.
Excel deletes the macro.
Delete a Macro
1 Press Alt+F8
The Macro dialog box appears.
2 Click the macro you want to delete.
3 Click Delete.
03_591598-ch01.indd 1903_591598-ch01.indd 19 6/11/10 1:41 PM6/11/10 1:41 PM