How to Create a Macro Button in Excel
Follow the below steps to add a shape in Excel to execute a macro:
Step 1. Click Insert in the Controls group of the Developer tab, then choose Button under From Controls. Add a button, “Run Macro”
Step 2. Right-click Shape and Press “Assign Macro”, to pop up the Assign Macro dialogue box
Step 3. Select “updateText” Macro and Press “OK”
Step 4. Just click the shape “Run Macro” in your Excel file to run the macro
The macro can now be executed by clicking its button. The assigned macro formats the chosen cells as seen in the screenshot below.
How to Enable & Run a Macro in Excel? 6 Ways
We can record a macro in Excel or write from scratch in VB Editor. Excel provides different options to run a macro. In this article, we explore four different approaches to running a macro in an Excel application.
Even while executing an Excel macro is a straightforward process for seasoned users, it might not be clear to newbies. You will discover numerous ways to execute macros in this article, some of which may entirely alter the way you interact with Excel files.
The below macro will write the text “Geeks for Geeks” in cell B5
Sub updateText()
ActiveSheet.Range(“B5”).Value = “Geeks for Geeks”
End Sub
Contact Us