Use Macros to Automate Tasks in MS Excel

Опубликовано: 06 Октябрь 2024
на канале: Ultimate Knowledge
39
1

An Excel macro is an action or a set of actions that can be recorded, named, saved and executed as many times as required and whenever desired. By using macros, we are able to automate repetitive tasks associated with data manipulation and data reporting that must be accomplished repeatedly.
Turn on Developer Tab:
 The Developer tab is hidden on the ribbon by default. To customize the ribbon, follow these steps:
 Right-click on the ribbon, anywhere and select (by clicking) Customize the ribbon.
 Navigate to Customize the ribbon and place a check on the Developer checkbox.
Record a Macro:
 Now that we have the developer tab on our ribbon, let’s start recording our first macro in Excel. To record a macro, follow these steps:
 On the Developer tab, go to Code group and click Record macro.
 The Record Macro dialog box will appear. Give your macro a name and assign the shortcut which will activate the macro. Click Ok.
Note: Every step you perform from now on will be recorded by the macro.
 Once you are done, go back to the developer tab and click stop recording.
 Your macro has recorded the steps, and you can now perform the same steps with the shortcut key you have assigned in the Record Macro dialog box.
Add a Button to Run Your Macro:
 In Excel, you can create a button that will run your macro. To do that, follow the steps below:
 Go to illustrations _ Shapes and select any shape. We will use a rectangle with rounded corners.
 You can also insert a button by going to the Developer tab _ Insert _ Form Controls.
 Add the text to the shape by right-clicking the shape and selecting edit text.
 Right-click the shape and select Assign Macro.
 Select the corresponding macro from the window and select (by clicking) Ok.
 Consequently, whenever you select (by clicking) that shape, Microsoft Excel will activate and run your recorded macro.