Microsoft Office Tutorials and References
In Depth Information
Run a Macro
Run a
Macro
You can run a macro from any open
workbook. You have the option of running the
macro from the VBA Editor or from Excel.
Excel maintains a list of the macros that are
stored in each open workbook. When you
want to run a macro, you can either open the
module that contains the macro or display the
list of available Excel macros. Either way, to
run a macro, you must first open the
workbook in which the macro is stored.
After you open a workbook, you have two
ways to run one of its macros: from the VBA
Editor or from Excel. It is best to use the VBA
Editor if you are testing the macro, because
although VBA switches to Excel to execute the
code, it returns you to the VBA Editor when it
is done. Therefore, you can run the code, see
whether it works properly, and then adjust the
code as necessary. When your code is working
properly, you can run it from Excel without
having to load the VBA Editor.
Run a Macro from the
VBA Editor
1 Open the module that
contains the macro.
2 Click any statement
within the macro you
want to run.
3
4
1
The macro name appears
in the list of macros.
3 Click Run.
4 Click Run Sub/UserForm.
2
You can also click the
Run icon (or press F5).
The VBA Editor runs the
macro.
Run a Macro from
Excel
1 Open the workbook that
contains the macro.
You can skip step 1 if the
macro is stored in the
Personal Macro
Workbook.
2 Click the View tab.
3 Click Macros.
2
3
If you have the Developer
tab displayed, you can
also click the Developer
tab and then click
Macros.
You can also press
Alt+F8.
 
Search JabSto ::




Custom Search