power4XL Microsoft Excel Resource Center
Free Macros, Formulas, Functions, Tutorials, Downloads, Add-Ins & More!

Launch a VBA function or macro from within a worksheet (1 of 3)

ShareThis

Once your VBA code for a given project is complete, you may find yourself working mainly with your Excel worksheet to change variables or adjust the model.  There are several options for executing the VBA code from within your worksheet.  Three of them are described here.

First, you can simply run the macro using the built-in menu structure or shortcut keys.  In any recent version of Excel, the key combination Alt+F8 will open the Macro dialogue.

Alternatively, in Excel 2003, you can select "Tools - Macro - Macros..." from the drop-down menu:

 

And in Excel 2007 you can select "Macros" from the Developer tab in the Ribbon:

In either version of Excel, the above actions will open the Macro dialogue.  Select the desired macro (VBA function), and press "Run."

 

 

Prev | Contents | Next

Copyright notice:  This site and all content, including computer code and spreadsheet examples, are copyright 2006 by Fritz Dooley.  License is granted for individual users to download examples and to copy code directly into user's spreadsheets and Visual Basic for Applications files.  Users may not redistribute code in any way.  Providing hyperlinks to this web site is encouraged, but posting code and examples on other web sites is expressly forbidden.  "Microsoft" is a registered trademark of Microsoft Corporation.   Neither this web site nor Fritz Dooley is affiliated with Microsoft Corporation.