Open In App

How to Configure Macros in Excel

Last Updated: 13 Dec, 2023

K

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

An action or collection of actions can be recorded, named, stored, and executed as many times as necessary and whenever desired using an Excel macro. We can automate repetitive data manipulation and reporting processes that need to be done repeatedly by using macros. You can record a macro and save it with any name to run it whenever you open the workbook that contains this macro.

What are Macros in Excel

Macros in Excel are the recorded sets of actions and these actions can be executed to do repetitive tasks or perform complex operations.

A Macro is a sequence of commands or cations that you record, and run whenever needed. Macros in Excel are created using the Virtual Basic for Application(VBA) programming language.

How to Create Macros

This can be divided in two ways as follows: 

1. How to Record a Macro 

Tip: While recording a Macro the user should be careful because a macro records everything even what went wrong and you have corrected it, so it is advisable to practice the task you want to perform once or twice before recording it.  

Recording a Macro is a method that allows you to store the tasks performed by you. To Record a Macro the Developer tab on the Ribbon needs to be activated. The Developer tab contains all the Macro tools among the various other features. 

2. How to Run a Macro

You can easily run a macro, once you have recorded and saved it into a workbook.

After recording a macro one needs to Run a macro to make use of it. Users can run a macro using the Macro command on the developer tab that is present on the Ribbon. To Run a Macro user can press a combination of shortcut keys, By clicking a button on the Quick Access toolbar or in a custom group in the ribbon.  

How to Record a Macro in Excel

Step 1: Open a new Excel Workbook. 

Step 2: Turn on the Developer Tab on the ribbon (The Developer tab is by default hidden).

To personalize the ribbon, do the following, Anywhere on the ribbon, use the right mouse button to choose (by clicking) Customize the ribbon.

select the customize ribbon.

 

Step 3: Place a check in the Developer checkbox by selecting Customize the ribbon from the menu. Click “OK”.

Step 4: The developer tab has been added to the ribbon. To configure a macro, on the Developer tab, go to Code group and click Record Macro.

Click on record macro to record a macro.

 

Step 5: You’ll see the Record Macro dialogue box.  

Give your macro a name and specify the shortcut that will run it. Click “OK.”

Things to remember

The macro name should start with a letter and contain no space, symbol, or punctuation marks.

  • Shortcut key(optional): The shortcut key must be unique, for example, it shouldn’t be ctrl+v which is for paste
  • Description: This is useful for you and the user for understanding the purpose of the macro.
Record-macro-dialogue-box-opens

Give the macro its name, shortcut key, and description.

Note: Every step you perform from now on will be recorded by the macro. For Example, We added some sample data in Book 1.

Sample-data-added

sample data 

Let’s now change the header’s format and add some colors.

Changing-header-format

changing the header’s format 

Step 5: Once you are done, go to the developer tab and click stop recording. The macro has recorded the steps.

New-data-added

all activities are recorded.

How to Run a Macro in Excel

You can now perform the same steps by running the macro

Step 1: Open a new sheet (or wherever you want to run a macro) in Excel, and add the data.

Note: To see the recorded macro, Click on Macros in the Developer ribbon: 

Recorded-macros

A list of recorded macros can be seen 

Step 2: Select the name of Macro. Click Run.

Running-macros

select the macro 

You could see the changes recorded in Macro are applied in the sheet.

Changes-in-recorded-macro-seen

Recorded macros 

FAQs on Macros

What is the shortcut to view all Macros?

The shortcut key to view all macros is  “ALT +F8”

What is the use of Macro in Excel?

  • Macros are recording of your daily routine task so that if the user wants to repeat the task it can be easily done by clicking a single button.
  •  Macros can be used to record the steps of inserting the data and formatting it.  

What is the Macro-Enabled Format?

If you want to save your macro then you must save your workbook of macros in macro-enabled format i.e. *.xlsm 

How do I enable macros in a specific Excel file?

  1. Open your Excel file.
  2. Find and click the “Info” tab.
  3. Enable the macro content.
  4. Check your next session

How to delete a Macro?

Step 1: Click on the Developer tab, and Click Macros. 

Step 2: From the list, click on the Macro, you want to delete, and click on the delete button.



K

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

Editing Excel Macros in Excel

article_img
Excel Macro is a set of actions that can be recorded, saved, used multiple times. This feature saves us a lot of time when dealing with repetitive tasks and huge data sets. We can always make changes to an existing Macro in Excel. There are two ways to record and run macros: Excel Commands Excel Visual Basic for Applications(VBA).1. Copying a Macro Code We can reuse the existing macro code while creating new Macros. For example, if you have existing macros created using the record function, we can reuse the code to write new macros. To open the code follow the below steps: Select Tools --> Macros --> Visual Basic Editor. Copy code from the existing macros(use Command + C) and paste(use Command + V) in the new macro2. Renaming a Macro Follow the below steps to rename a Macro in Excel: Select Tools --> Macros --> Visual Basic Editor. Select name on the left plane.Edit the name.3. Deleting a Macro Follow the below steps to delete a macro in Excel: Select Tools --> Macros --> Macros... Select the macro to be deleted. Click on the minus(-) symbol at the bottom.Select yes to delete the macro.
Read More

UserForms in Excel Macros

article_img
A UserFrom refers to a form or a dialog box on the screen that enables a user to input data into Excel's user interface. it can be created using the Visual Basic Editor and is used to control data entry and avoid errors. 1. Creating a UserForm: To create a userform head on to the Developer tab-> Visual Basic->Insert->UserForm. You can also go to the Project window on the left side and right-click the workbook you want to use and select Insert->UserForm. This opens up a blank userform (UserForm1) and a toolbox(if the toolbox doesn't pop up head on to View>toolbox). 2. Naming the UserForm: By default, excel opens up an userform with the name UserForm1 in order to change that name: Head to the Properties window(view>Properties window), This opens a pane on the left.Click on the 'Name' section and type a name of your choice. (don't add spaces)The name won't be reflected on the userform when you do so because that's a different property of the form.Head to the 'Caption' property and type in a name, and it will be reflected on your UserForm. Now let's play with some controls and learn how to add them to our UserForm. 3. Adding a Textbox to the UserForm: A Textbox is u
Read More

Relative References in Excel Macros

article_img
We have two options to refer a cell in Excel VBA Absolute references and Relative references.  Default Excel records macro in Absolute mode. In this article, we learn about Relative references in Excel VBA.  We select a cell “A1”, turn on “Use Relative Reference” and record a macro to type some text in cells B2:B4.   Since we turn on the “Relative reference” option.  Macro considers the number of rows and columns from active cells.  In our example, we select cell A1 and start type B2, which is to move one column and one row from A1 (Active cell). What are Relative References?In Excel, the way of recording actions within a macro that is relative to the cell or range that the macro starts from is known as a relative reference. When you start recording a macro with relative reference, Excel records the actions based on the position of the active cell at the beginning of the macro. The recorded actions will adjust accordingly when the macro is run on different ranges. Using Relative ReferencesWe must make sure that the macro is recorded starting from the cell where the steps must begin in order to record a macro with relative references. ImplementationFollow the below steps to implemen
Read More

Absolute References in Excel Macros

article_img
Excel Macros are incredibly powerful tools that provide the capability to automate repetitive tasks, streamline processes, and save time. When building macros, it's common to use cell references for performing calculations or actions. In some situations, it's important to ensure that these references remain fixed, no matter where the macro is applied or copied. Here the absolute reference plays an important role. We have two options to refer a cell in Excel VBA Absolute references and Relative references.  Default Excel records macro in Absolute mode. Both absolute references and relative references can be used while recording Excel macros. Regardless of the active cell, a macro recorded using absolute references places the recorded steps exactly in the cells where it was recorded. However, a macro that has been recorded with relative references can carry out the activities at several locations on the worksheet. In this article, we will learn about absolute references in Excel VBA. We record a macro to type some text in cells B2:B4.  Macro always types the text in the cells B2:B4, irrespective of the active cell. Ensuring Absolute ReferencesWe must make sure that the macro is recor
Read More

How to Automate Repetitive Tasks in Excel Without VBA Macros

article_img
Automating repetitive tasks in Excel can save you significant time and effort, even if you're unfamiliar with VBA macros. Excel offers built-in tools and features that allow users to streamline workflows and reduce manual work without any coding knowledge. From using Power Query for data transformation to Excel formulas, Flash Fill, and built-in automation tools, this guide will show you how to simplify repetitive tasks and boost productivity, all without the complexity of macros. How to Automate Repetitive Tasks in Excel Table of ContentUsing Excel's Built-In Features for AutomationHow to Excel's Built-In FeaturesIdentify the TaskChoose the Appropriate Built-In Feature Implement the FeatureRecording Macros Without VBA: A Simple GuideAutomating Complex Tasks with Excel's Macro RecorderTesting and Validating Your Excel AutomationsSaving Excel Workbooks with Macro SupportDocumenting Your Excel Automation ProcessesGetting Started with Excel MacrosRecording your First MacroUnderstanding Relative ReferencesEditing and Customizing Macros in ExcelWhy Automate Tasks in Excel Without VBAAutomation in Excel improves productivity, reduces human error, and allows you to focus on analysis rathe
Read More

N

How to Create a Macro in Excel: Build, Run, and Use Macros Easily

article_img
How Do I Create a Macro in Excel- Quick StepsOpen MS Excel > Start Recording a MacroPerform the Actions You Want to Automate > Stop RecordingRun the MacroAre repetitive tasks consuming your time in Excel? With this Excel macros tutorial, you can learn how to create and use macros in Excel to automate tasks and improve efficiency. This guide will walk you through the essentials, from understanding what macros are to creating a macro button for quick access. Whether you're a beginner looking for a step-by-step guide to Excel macros or someone eager to explore advanced features, this article provides everything you need to make and run a macro with ease.How to Create a Macro in ExcelTable of ContentWhat is Macro in Excel Uses of Macros in ExcelHow to Create a Macro in ExcelHow to Run a Macro in ExcelHow to Create a Macro button in ExcelEasy Tips for Creating a Macro What is Macro in Excel An Excel Macros is a set of instructions that you can create to automate repetitive tasks. Think of it like a recorded script that performs actions such as formatting cells, entering data, or generating reports, all with just a single click. This helps save time and reduces the chance of errors
Read More

How to Enable Macros in Excel (2025): Step-by-Step Guide

article_img
How to Activate Macros in Excel - Quick StepsOpen WorkbookClick Enable Content in the yellow security warning bar.Adjust Macro Settings (Optional):Go to File > Options > Trust Center > Trust Center Settings > Macro Settings.Choose the desired macro setting (e.g., Enable All Macros for trusted files).Save the file .xlsm to retain macros.Macros are an essential feature that helps automate repetitive tasks, making your workflow faster and more efficient. However, since macros involve executing scripts, Excel disables them by default for security reasons. This article provides a simple, step-by-step guide on how to enable macros in Excel, whether you need them for a single session or want to allow them permanently. If you’ve been looking for ways to streamline your tasks while ensuring data security, this guide is for you.Table of ContentWhat Are Macros in Excel and Why Are They Disabled by DefaultStep-by-Step Guide to Enable Macros in ExcelHow to Enable Macros in Excel on MacHow to Change Macro Security Settings in ExcelSecurity Best Practices for Enabling MacrosCommon Issues and TroubleshootingHow to Enable Macros in ExcelWhat Are Macros in Excel and Why Are They Disabled
Read More

Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024

article_img
Are you ready to unlock a world of opportunities with Microsoft Excel? In today’s data-driven job market, mastering Excel is essential for launching a successful career, whether you're a fresher or an experienced professional. In this article, we will cover the high-paying Excel jobs available in 2024, including crucial roles like data analyst, business analyst, and many more. We'll explore the qualifications needed for these positions, along with salary estimations to help you understand your earning potential. Whether you’re looking for Excel jobs for freshers or seasoned professionals, we’ll also dive into options for Excel freelancing jobs and work-from-home jobs in Excel. Equip yourself with the knowledge to excel in your career and take the first step toward a lucrative future!Best Microsoft Excel High-Paying Jobs with Excel Skills in 2024Table of ContentWhy choose a career in ExcelWhy Excel Skills Are Essential for Your CareerEssential Excel Skills Required to Boost Your Resume Best Microsoft Excel High-Paying JobsFinancial AnalystsData AnalystAdministrative Assistant Accountants Project ManagersManagement ConsultantRetail Store ManagersBusiness Analyst Market Research A
Read More

Excel VLOOKUP Function - Excel Guide for Beginners

article_img
How to do Vlookup in Excel - Quick StepsPrepare Your DataEnter the VLOOKUP Formula >>Press EnterUse a Cell Reference for Flexibility Copy the Formula for Multiple RowsThe VLOOKUP function is one of the most widely used tools in Excel for looking up and retrieving data from a table. Whether you’re working with a single sheet or multiple workbooks, VLOOKUP allows you to search for a value in one column and return a related value from another. If you're new to Excel or still getting the hang of formulas, this guide is for you. We will cover everything from the basics of how VLOOKUP works to practical examples that show how to search data across sheets, troubleshoot common issues, and master the VLOOKUP formula for any task.Excel VLOOKUP FunctionWhat is the VLOOKUP Function in ExcelThe term VLOOKUP stands for Vertical Lookup. It is designed to search for a specific value in the first column of a table (lookup column) and retrieve corresponding data from a different column in the same row.Syntax of VLOOKUP FormulaVLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])Arguments:1. lookup_value: The value you want to search for (e.g., a specific ID, name, or product code).
Read More

AI in Excel: Top 20 Excel AI Tools in 2025 (Free/Paid)

article_img
The integration of AI in Excel is transforming the way professionals manage, analyze, and visualize data. Whether you're handling large datasets, performing financial analysis, or automating repetitive tasks, AI-powered tools can significantly improve efficiency and accuracy. In 2025, advanced Excel AI tools are making complex tasks easier by offering features like data cleaning, predictive analytics, smart automation, and AI-driven insights.In this guide, we’ve gathered a list of the top 20 Excel AI tools for 2025 that are reshaping how users interact with Excel.Table of ContentBest AI Tool in Excel: Top Picks for 2025Top 10 Free Excel AI Tools in 2025Top 10 Excel AI ToolsAI in Excel: OverviewIn Excel, an AI tool (Artificial Intelligence tool) refers to an add-in or extension that leverages artificial intelligence to enhance your spreadsheet experience. These tools can automate tasks, improve data analysis, and generally make you more productive.Excel has always been a powerful tool for data analysis, but with the integration of AI tools, it has transformed into a smarter, more intuitive platform.Best AI Tool in Excel: Top Picks for 2025Explore the below AI tools designed for auto
Read More
three90RightbarBannerImg