Tuesday 10 March 2015

Record a Macro in Excel

To automate the manual tasks you do repeatedly, you can use a simple macro. Below is an simple example of how we can use a macro to automate tasks

Consider for example a table of data as shown. And you need to repeatedly format a cell with a particular format (bold, bordered, background yellowed, font in red color).

Basic example of a macro
Step 1: Click the Record Macro button on the bottom left of excel window

Record button in Excel Window
Step 2: A dialogue box opens as shown below. Change the Macro name (if needed), put a shortcut key, scope of the macro and description. If you intend to use a lot of macros, it is a good practice to fill the details. Click Ok after all the details are filled.

Macro record dialogue box
Step 3: The macro continues recording until you manual stop the recording. Be careful what you do after the macro is recording. Do not change the selected cell. Change formatting of the cell (selected before recording a macro). Go to the Record Macro button (now the logo will be different and looks like a stop button) and click it. This stops the recording of the Macro.

Step 4: The macro is now ready to do manual tasks automatically. Select any cell and click the shortcut key chosen in Step 2. The cell will redo all the actions recorded by the macro.

Note: You will not be able to undo the changes you made using a Macro. Be careful with a Macro

Hope that helps,
Ramada

PS: please feel free to drop you excel/ word/ power point queries to mad.exceltips@gmail.com. I will try and respond as soon as I can. The more curious your question, the faster I respond.