Macros are set of instructions that are written into an Excel VBA (Visual Basic For Application).
With the help of Macros, you can record and automate the tasks in Excel.
Macros are the most powerful features in Excel.
If you run recorded macros it will automate the recorded tasks. macros save a lot of time in routine works.
In this tutorial, you are going to learn how to enable and create a simple macro with an example.
To record macros in Excel first, you need to enable the Developer option in Excel Ribbon.
To enable the Developer Tab, follow the below steps.
1. In Windows Go to File -->Options-->Customize Ribbon--> then check the Developer Check box.
2. In Mac Go to Excel-->Preferences-->Ribbon & Toolbar--> then check the Developer Check box.
3. In the Developer Tab you will get the Record Macro option.
4. One more method to use Macros in Excel is, you can use direct record macro shortcut at the bottom of the excel sheet.
Using any one of the above methods you can start recording a macro in Excel.
In this example, I want to record copy and paste macro. for this
1. Click on the record macro button (Check Relative References).
2. Give a name to macro..here I will give the name copypaste.
3. Select the range of cells to copy (A1:B5).
4. And paste copied cells into other columns (D1:E5).
5. Click on the Stop Recording button.
After completing a macro recording you can assign macro to the command button which is available in the Developer Tab.
In this above example, I have recorded a copy and paste task in Macros and also assigned to button.
If somebody clicks on that button the same copy and paste task will execute automatically.
To delete recorded macro execute the below steps.
1. Go to View Tab-->Click on View Macros.
2. Select the macro you want to delete.
3. Click on Delete Macro Button and give Ok.
After watching the video you can download the below sample sheet. and it helps you to do practice more.