How to Record a Macro in Excel?
“How to Record Macros in Excel? Recording macro in Excel VBA is very useful tool. Why we use this tool to record macro? Reason is very simple that if we are doing the same task in Excel and again and again, then macro recorder comes in existence. We use macro recorder for reducing time taken in our daily task.
By the below given image we will understand macro recording step by step:-
Open the Excel and go to Developer tab and click on it.
And then click on the Record Macro and following image will appear
Once you click on the “OK” button in above image then macro will record everything, whatever action or step you will do in excel.
Main thing about macro recording is that it will record every single step, we will take. So my suggestion is plan first to record macro and then record it and if you will not make a plan and start recording, it will record unnecessary step also.
Below is the details about above circled number in macro recorder box.
1. Macro Name
2.Assign Shortcut Key
3. Store macro in
Personal Macro Workbook
4. Description Box
Recording” button, this means now Excel has started record our steps and when our step for macro recording is finished then we simply click on this “Stop Recording” button and macro is recorded successfully.
I type “a” in cell “C5” and “b” in cell “C7” and click on Stop Recording button, and see how a macro recorder record a macro in below image:-
First it type the Macro name ” Sub Macro4 ()” and then record below mention thing like, first it select cell “C5” and then type “a” and then select cell “C7” and type “b” and then select cell “C8” and then I stop recording by pressing “Stop Recording Button” as appearing in the below image.
And once we press stop recording button the macro recorder has finished its job, macro recording is done.
Now if we want to check our macro, simply go to Developer tab –> Macro and click on the “Macro” button
Once you click on the “Macro” button, the following image will appear
We will see that macro name, we put “Macro_name” and below “Macro in” means will work on the, the workbook we selected that time when we record the macro, select “This Workbook” and press “Run” button the will get the following image
Both the figure comes automatically in the cell “C5” and “C7” and another way to run this macro is simply type “Ctrl+Shift+L” because we have given a shortcut name to our macro. See Image 3.
And we will get the same result. try this…