What is a macro in Excel? How to create and run a Macro in Excel
Macros are small programs that help you automate repetitive tasks that you use in Excel. Recording macros is recording the steps in VBA code (Visual Basic for Applications). The following article will help you do not need to know the language of VBA programming but still help you create small macros and re-run macros whenever necessary.
Turn on the Developer tab in Excel
If your Excel software does not have a Developer tab , you can turn it on in the following way. On the File (1) -> choose Options (2) .
Excel Options window appears, select Customize Ribbon (3) -> Check in Developer (4) => Select OK (5) .
The Developer tab has appeared on the Ribbon. You can now use macros for excel.
How to record a Macro
Recording a Macro is quite simple, but note that the Macro Recorder will record the entire process you perform. If you make a mistake during recording, that action will be logged. So be very careful during Macro recording to avoid losing time recording offline.
The operation to record a Macro is as follows:
(1) On the Developer tab, select Record Macro . The Record Macro windowappears.
(2) You correct the Macro name to make it easier to remember. Click OK.
And start performing the operations on Excel that you want to record.
(3) When you want to stop recording Macro, on the Developer tab, click Stop Recording.
Run the recorded Macro in Excel
Open the Macro dialog box by clicking the key combination Alt + F8 or in the Developer tab select Macro. Macro window appears.
(1) Select the Macro command youwant to apply.
(2) Select the area where you want to apply the Macro command.
- All Open Workbooks: applies to all open windows.
- This Workbooks: applies to the window you are selecting.
(3) Select Run to run the Macro.
The macro will be run and the calculations will be performed in turn as you have noted earlier.
Save the Macro file
Please note, Macro File cannot be saved as a normal Excel file format (.xlsx).
If you want to save all Excel and Macro files, select File -> Save as -> Save as type : Choose Excel Macro-Enable Workbook . The saved file will be saved as a .xlsm file.
If you only want to save the VBA code of the Macro, You press Alt + F11 . The Microsoft Visual Basic for Applications window appears. Right-click on the Module containing the VBA code of the Macro to save. Select Export file and save Macro as .bas file.
Above Software Tips guide you the easiest steps to record macros and run macros in Excel. Good luck!
You should read it
- MS Excel 2003 - Lesson 8: Excel Macro - Automate complex tasks
- How to troubleshoot macros in Excel not working
- How to Remove a Macro in Excel
- The easiest way to Use Macros in Excel
- How to separate sheets into separate Excel files
- 5 source to get macro to automate Excel spreadsheets
- How to Write a Simple Macro in Microsoft Excel
- Attack analysis uses Excel 4.0 macros to disguise
- How to turn on, turn off, delete Macro in Excel
- How to Create a Custom Macro Button in Excel
- How to Add Rows in Excel Using Formulas
- How to turn on / off Macro in Word