Macro+in+Excel


 * Macro in Excel **

A macro is a recording of the commands and actions which are used in order to perform a task. Whenever you find that there is a particular task or series of tasks which you perform often, it may make sense to save the sequence of tasks as a macro for reuse later. Thus the applications of Macros to perform frequently occurring repetitive tasks can help free up your time to be spent more productively on doing something else instead.
 * What is a Macro?**

There are two ways of creating macros within Microsoft Excel
 * How to Create Macros**

1. The first is the Macro Recorder. Excel provides the ability to create macros by creating a recording of the tasks performed by the user. The Macro recorder is usually made use of for simple macros.

2. The second is using the macro editor which is used when complicated macros are required. The **Macro** section can be accessed from within the **View** tab or the **Developer** tab in the Ribbon in Microsoft Excel.

The sequence of steps below details how to record a macro in Microsoft Excel
 * Recording a Macro**

1. Open Microsoft Excel by clicking on:- **Start > Programs > Microsoft Office > Microsoft Excel**. Alternatively, go to **Start > Run** and type **Excel** and click the **Enter** key.

2. Navigate to the Macros section by clicking on the **View** tab in the Ribbon. Then select the **Macros** button. 3. A drop down menu appears in which View Macro and Record Macro options are available. 4. Click on the **Record Macro** button. A dialog box appears a. Provide a suitable name for the macro. b. Set a shortcut key for the macro (if required). c. Choose where to store the macro, within ‘this workbook’, in a ‘new workbook’ or in a ‘personal macro workbook’. By default, it will be ‘this workbook’. d. Give a detailed description (if required).

5. Perform the series of actions which you want saved within the macro. This step is very important and must be performed without any error because even the errors will get recorded as part of the macro. 6. Once you are done performing the steps required, click on the Macro button and choose **Stop Recording** from the drop down menu. 7. In order to run a saved macro, choose the Macro button and click on:- **View Macros**. A dialog box appears from which the required macro can be selected and run by clicking the Run button. Alternatively, if you know the keyboard shortcut assigned to that macro while creation, you can make use of the shortcut. Click on the **Edit** button to open **Visual Basic Editor** to edit the macro’s code. Click on **Step Into** to run the macro in Debug mode. Use the **Delete** key to delete unwanted macros.

Whenever you open an .XLSM file, by default macros are disabled. This is to protect users from unknown content. Click on the **Options** button and select **Enable his content** in order to enable the use of macros in your spreadsheet.