If you’re working with Microsoft Excel, you’re often doing repetitive work. Doing the same job repeatedly, of course, is very tedious and tiring if there are a lot of them.
To do this work, you can use the Macros in Microsoft Excel. The macro will record all your actions from mouse clicks and keyboard keystrokes. You can also edit the macro to suit your needs.
Other Interesting Articles
Showing Macro
Macro and VBA tools can be found on the Developer tab, which is hidden by default, so the first step is to enable them.
On the File tab, select Options > Customize Ribbon.
Then you can find the Macro tool on the Developer tab.
Recording Macro
- On the Developer tab, click the “Record Macro” button
- Then do the work you want to automate, such as setting cell formats, fonts and others.
- When finished, click the “Stop Recording” button
Creating a simple Macro to set cell format
In this sample macro, we will create a macro to give a border, set the font size and style.
- Create sample data in Excel and select the data that you set the format for, for example as follows
- Then you click the “Record Macro” button. In the window that appears, you can give the name of the Macro that you created and can also add a Shortcut for easy access . You need to pay attention when creating shortcuts, do not use shortcuts that have been used by Excel or Windows. Click the “OK” button to start recording.
- Do the work you are going to record. In this example we will create a border on the cell that we selected, then change the font size and style, and also set the number format.
Click the “Stop Recording” button, if you have finished doing the work and stop the recording process from the macro.
- To edit and view the Macros that you have created, you can do so by clicking the “Macros” button and then selecting the macros in the list. Then click the “Edit” button to make the necessary changes or view the generated VBA code.
You can make changes to the VBA code that is formed according to your needs.
- To run the macro that we have created, select the cells that you want to format. Then open Macro and click “Run” to run the macro.
- To save an Excel file with Macros, you must save it in the “. xlsm ”
Thank you for visiting Bardimin. Thank you…..