Running a VBA Macro

     

The Office applications offer several methods for running your VBA macros, but there are two that you'll use most often:

  • In a module, place the insertion point anywhere inside the macro and then either select Run, Run Sub/UserForm or press the F5 key.

  • In the Office application, select Tools, Macro, Macros (or press Alt+F8) to display the Macro dialog box. If necessary, use the Macros In box to choose the document that contains the macro you want to work with. Now use the Macro Name list to highlight the macro; then click the Run button.

If you try this on the sample macro that you created in the previous section, you should see dialog box appear with the text Hello VBA World! . Click OK to close the dialog box.



Absolute Beginner's Guide to VBA
Absolute Beginners Guide to VBA
ISBN: 0789730766
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net