Sunday, February 15, 2015

How to use Excel Macro Recorder ?

The Excel Macro Recorder is a very useful tool included in Excel VBA. With the Excel Macro Recorder you can record a task you perform with Excel. Next, you can execute the task over and over with the click of a button which can save you a lot of time.

The Macro Recorder, a very useful tool included in Excel VBA, records every task you perform with Excel. This is good news if you want to automate repetitive tasks. All you have to do is record a specific task once. Next, you can execute the task over and over with the click of a button. This can save you a lot of time! The Macro Recorder is also a great help when you don't know how to program a specific task in Excel VBA. Simply open the Visual Basic Editor after recording the task to see how it can be programmed.

There are a lot of things you cannot do with the Excel Macro Recorder. For example, we cannot loop through a range of data with the Macro Recorder. Also, the Macro Recorder uses a lot more code than actually required, which can slow your execution process.

To record, run and edit a recorded macro, follow the below steps:
1. Click on the Developer tab


2. Click on Record Macro. See the picture below. Each of the commands you perform will be saved into the macro.


3. Here you can give your macro a name and you can enter a shortcut for your macro (both optional). You can store your macro in three workbooks. If you choose to store your macro in Personal Macro Workbook, the macro will be available to all your workbooks (Excel Files). This is because Excel stores your macro in a hidden workbook that opens automatically when Excel starts. If you choose to store your macro in New Workbook, the macro will only be available in an automatically new opened workbook. If you choose to store your macro in This Workbook, the macro will only be available in the current workbook.


We will now record a macro that changes the format of Cells to Number with zero decimals.

4. Click on OK.
5. Right mouse click on the active cell (selected cell). Be sure not to select any other cell! Then click on Format Cells...


6. Choose Number and click on OK.





Below is the before and after formatting result:






No comments:

Post a Comment