Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Software»Excel»How to Create a Macro in Excel

How to Create a Macro in Excel

Asmi DhakalBy Asmi DhakalNovember 4, 2022
how to create a macro in excel

Excel offers the feature of recording macros to computerize recurring tasks. Macros are a set of commands compiled together in the form of a code that can run recorded instructions to automate a task. You can use Macros when you repeat the same set of functions on Excel. Running macros saves time in tasks that generally take some time.

If you often find yourself repeating the same set of tasks, consider creating macros in Excel. In this article, we will be delving into the steps you could follow to create a macro in Excel, so keep reading!

Table of Contents

  • How to Create a Macro in Excel?
    • Step 1: Enable Developer Tab
    • Step 2: Record a Macro
    • Step 3: Edit Your Macro
  • How to Run a Macro in MS Excel?
  • How to Delete a Macro in MS Excel?

How to Create a Macro in Excel?

Excel records your mouse clicks and keystrokes to create a macro which is then stored as a code in the Visual Basics Language. Creating a macro can be a bit tricky if you’re not used to the programming language. However, you could go through the process of trial and error to create the macro.

Step 1: Enable Developer Tab

You can only create a Macro in the Developer tab. By default, the Developer tab is hidden from the menu bar. You can, however, customize your menu bar to display the developer tab. Your first step towards creating a macro is to enable the developer tab from Excel Options.

Refer to the following steps to enable the Developer Tab on the menu bar of your Excel program:

  1. Launch MS Excel.
  2. From the sidebar, select Options. If you do not see it, head to More > Options.
    Excel Options
  3. Select Customize Ribbon from the panel to your left.
    Customize Ribbon Excel Options
  4. Choose Main Tabs under Customize the ribbon.
    Main Tabs Excel
  5. Select the box next to Developer.
    Enable Developer Tab Excel Menu Bar
  6. Click OK.

Step 2: Record a Macro

Now that you have enabled the Developer tab on the menu bar, you can head to the tab to record your macro. As we mentioned, when you record your macro, Excel registers your keystrokes and compiles them as a singular command. So, while recording them, remember to carry on with your actions exactly how you wish to replicate. 

Here are the steps you can follow in recording a macro on MS Excel:

  1. Open the MS Excel application to open a workbook.
  2. Head to the Developer Tab.
  3. Select Record Macro from the Code section.
    Record Macro Option Excel
  4. In the Record Macro window, enter the following details:
    • Macro name: Give your Macro a name to uniquely identify it.
    • Shortcut key: Enter a shortcut that will call the Macro in the Excel workbook. Remember not to use an existing shortcut, as Excel will override that command to run the Macro.
    • Store macro in: Choose where you want the recorded macro to work in.
    • Description: If you want to jot down any comments about the macro, enter them in this section.
      Record Macro
  5. Carry on with the action you wish to record as a macro.
  6. After you’re done, select Stop recording on the Developer ribbon.
    Stop Recording Macro Excel

Step 3: Edit Your Macro

After you’re done recording your Macro, you may want to tweak a few things in the code. You could’ve accidentally entered a command you would not wish to replicate while the macro is automating your tasks.

As we’ve mentioned prior to this, a macro is stored as a code in the Visual Basic programming language. Hence, you need to understand the language before attempting to make any changes in the code.

Follow these steps to edit your macro from the Visual Basic Editor:

  1. Select the Developer tab.
  2. Choose Macros from the code section.
    Excel Macros
  3. Choose your Macro, then select Edit.
    Edit Macro Excel
  4. View the Visual Basic Code and make the necessary changes.
  5. Run the macro, then see if it works as you like.

How to Run a Macro in MS Excel?

You can run a macro you’ve created in Excel from the Developer tab. If you do not have the Developer tab enabled, head to Excel Options to turn on the display for this tab. Once you’ve enabled the tab, follow these steps to run your Macro in MS Excel:

  1. Open your Excel file. 
  2. Select the Developer tab from the menu bar.
  3. Choose Macros from the ribbon in the Code group.
    Excel Macros
  4. Select the Macro you wish to run under Macro name.
  5. Click on the Run button.
    Run Macro Excel

How to Delete a Macro in MS Excel?

If you no longer need to use a Macro, you can quickly delete it. It is a good idea to get rid of Macros you don’t use, as they usually take up space and increase the size of your workbook.

If you wish to delete a Macro in MS Excel, follow these steps:

  1. Open your Excel workbook.
  2. Select the Developer tab.
    developer-tab-in-excel
  3. Click Macros from the Code section.
    Excel Macros
  4. Select your Macro from the box, then select the Delete button.
    Delete Macro Excel
Asmi Dhakal
  • Twitter
  • LinkedIn

Asmi Dhakal is a Tech Writer specializing in Microsoft Office-based programs at TechNewsToday. She aims to use her experience to help others learn their way around its programs. Asmi’s interest in Office products grew when she first entered the marketing industry. While she initially struggled to understand their application, she eventually understood her way around them. In her articles, she exhibits a strong understanding of related issues and attempts to push only relevant fixes. Over time, she has grown a particular fondness for MS Excel and spends her free time learning Visual Basic Analysis (VBA). She’s always on the lookout for productivity tools that can get the job done quicker in Excel. Her approach to related problems is very humane, helping new users not only fix the issue but learn more about its nature. Asmi also heavily indulges in personal writing. She is a disciplined journal writer and has maintained a regular journal for 8 years! When her schedule allows, she works to rehabilitate street animals. You can contact her at asmi@technewstoday.com

Related Posts

check mark in excel

How to Put Check Mark in Excel

January 20, 2023
best excel shortcuts

Best 52 Excel Shortcuts Only Experts Know

January 19, 2023
How to Find and edit Hyperlinks on Excel

How to Find and Edit Hyperlinks on Excel

January 23, 2023
how to find unique values in excel

How to Find Unique Values in Excel

January 15, 2023
how to find links in excel

How to Find and Edit External Links in Excel

January 13, 2023
reference isn't valid excel

Reference Isn’t Valid Excel Error – 6 Ways to Fix it

January 6, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
do-smart-tvs-have-bluetooth

Do Smart TVs Have Bluetooth? How to Check

January 30, 2023
spectrum port forwarding

How to Port Forward on Spectrum

January 30, 2023
how-to-use-a-usb-flash-drive

How to Use a USB Flash Drive (Detailed Guide)

January 30, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.