• Excel Video Tutorials

Using Macros in Excel



What are Macros in Excel?

Microsoft Excel Macros are small codes that automate repetitive tasks written in VBA. If you are unfamiliar with the VBA language, you can utilize the Macro recorder, which records your actions, like keystrokes and mouse clicks. It saves users time and performs similar tasks quickly after inspecting your actions. Macros are stored either in the active workbook or in the Personal Macro Workbook.

Record a Macros

Various methods to record a Macros −

  • Utilize the "Record Macro" is available under the "Code" group in the "Developer" tab.
  • It is also available in the View Choose the Macros button where the "Record Macro" option is presented.
  • Use the "Record Macro" button available in the status bar.
Record a Macros

How do you Create a Macro in Excel?

Microsoft Excel Macros can be created by recording the Macros available in the Developer tab. The task is to format the given dataset using Macro. Go to the Developer tab and select the "Record Macro" under the Code group.

Record a Macros

After that, another dialog box, "Record Macro," will open. Specify the Macro name and type k in the Shortcut key: section. Optionally, you can write the Macro description in the Description box. And then click the Ok button.

Record a Macros

Note − You can use the shortcut key ctrl +k to run the macro.

First, you must select the B2 cell and perform the various actions while recording Macro.

  • Go to the Home tab and set the "Aptos narrow" font from the Font drop-down menu.
  • Set the "Dark Blue" background color of the cell.
  • Set the Font size to 14 and set the Italic and underlined font style.

The formatting of the B2 cell has changed. After that, press the "Stop the recording" button in the Status Bar.

Record a Macros

Place the cursor on the C2 cell and press the shortcut key "ctrl + k". As you can see in the screenshot, a series of formatting actions are performed using Macros.

Record a Macros

Similarly, you can modify the default formatting of the other cells.

Advertisements