The Macro Recorder
A macro is VBA code that you can call to execute any number of actions. In Microsoft Excel they can be written or recorded. Recording a macro is basically recording your actions while you perform them and while you are recording, Excel is translating and storing your keystrokes and mouse clicks to VBA code. a quick way to learn the relevant syntax for a task is to turn on the macro recorder when writing VBA code that will allow you to record some of the actions you perform in Excel.
To create your first macro, you need to have the developer tab which contains the features for creating, recording and managing macros. Unfortunately most excel versions come with this feature deactivated. To activate the developer tab, use the following steps:
- Click on File
- Click on Options
- Click on Customize ribbon in the menu that appears
- In the list box on the right, click on the small box next to Developer. A tick will appear in the small box.
- Click OK.
The Developer Tab is now visible on the Excel ribbon. Click on it and select record macro command found in the code group. The record macro dialog box appears as shown below
Select your target cell before recording your macro. This step is important because it makes your macro a general purpose macro. This way, when running the macro, it will be executed in any cell of your choice. However, if you selected a cell after your macro started recording, the actual cell you selected will be recorded into the macro.
Absolute and Relative Macro Recording
Excel's default recording mode is in absolute reference.
Post a Comment