Starting a Macro in Excel
|
613-749-4695 (Peter) |
Tips and Ideas on Excel |
Tips and Ideas on Macros |
VBA Chapter 9 of 24: Starting a Macro in ExcelWhen does the VBA procedure (macro) start? When an EVENT happens. The event is what triggers the VBA Excel procedure. From the Menu Bar In Excel you can run an Excel VBA macro by going to the menu "Tool/Macro/Macros.." then select the macro from the list and click "Run" . Open many workbooks with macros in them. When you go to the menu "Tool/Macro/Macros.." you will notice that you have access to all the macros from all the open workbooks. This means that you can store ALL your useful Excel macros in a single workbook (call it myMacros.xls) and have access to them while the workbook is opened. Let's say for example that you have designed a macro that multiplies the content of a cell by 2. If "myMacros.xls" is open you can call this Excel macro from any cell in any other workbook that is open. No need to copy your essential macros in all your workbooks just open myMacros.xls and put them to work. Clicking on a Key of your Keyboard First you need to program a key. To do so go to "Tool/Macro/Macros.." then select a macro from the list. Click on "Options" and follow the instructions. A suggestion, assign your macros to upper case keys ("Shift/A" instead of "Shift/a for example) to make sure that you don't use one of the many lower case keys that are already used by Excel. You can also assign a macro to a key when you use the Excel Macro recorder. |
Next Chapter: VBA for Excel Code Tips |
VBA Table of Contents |
Discover Even More in 50 Excel spreadsheets |
|
613-749-4695 (Peter) |
Tips and Ideas on Excel |
Tips and Ideas on Macros |
Starting a Macro in Excel