Saturday 19 April 2014

Macros / How to Record Macros in Excel

MACROS:

Macros is one of the best function in Excel. With the help of Macros you can automate your work. Macro is a set of instructions that tells excel what to do. Macros commands are written in Visual Basic for Applications(VBA) programming language.

Macro function records your actions or commands. Recorded macros can be run whenever you want, automatically repeating your recorded actions and saving your time and effort.

Record a Macro:
Record Macro
Here we try recording a macro to produce your name and address:
1- Go to Developer Tab, click on Record Macro.

* Developer Tab- If Developer Tab is disable you can enable it. To enable Developer Tab click on Office button which is on the most left upper corner then click on Excel Options. On the Popular menu check Show Developer tab in the Ribbon.

2- Enter Macro name as Excel_Add in the Macro name box.
* Macro name should start with alphabets, doesn't accept spaces, instead of space can use ( _ )underscore as a word separator.

3- Enter a shortcut key in Shortcut key box.
* To assign a shortcut key for your macro either you can type a single character(character which is not used already for any shortcut key for excel) or can type with SHIFT key.


4- Leave the setting at This Workbook in the Store macro in box.

5- In Description box, give the description for your macro whatever you want and click OK.

Excel Sheet
6- Now on Sheet1, go to the cell A1 and type your name and address.(You can format your text as you want).
7- Now on the Developer tab click on Stop Recording button.
Now a Macro has been recorded.




Macros

Running a Macro:

To run a macro follow the steps given below:

1- Select the cell where you want to run the record macro. 

2- Go to Developer Tab, click on Macro button. A dialogue box with Macro name will open.

3- Select your macro which you name as Excel_Add and click on Run.

OR
1- You can just simple press your shortcut key which you created at the time of macro recording.


0 comments:

Post a Comment