Creating Buttons

Buttons in Excel allow users to run macros with a single click. They make your workbook interactive and user-friendly, especially in dashboards and automated reports.

Buttons are commonly linked to VBA macros.

Why Create Buttons?

  • Run macros easily
  • Improve user experience
  • Create interactive dashboards
  • Simplify report automation
  • Avoid opening VBA editor

Method 1: Create Form Control Button (Recommended)

Steps:

  1. Go to Developer Tab
  2. Click Insert
  3. Under Form Controls, select Button
  4. Draw the button on the worksheet
  5. “Assign Macro” window appears
  6. Select your macro
  7. Click OK

Your button is ready.

Edit Button Text

  • Right-click the button
  • Click Edit Text
  • Rename (e.g., “Generate Report”)

Method 2: Create Shape as Button

You can also use shapes:

Steps:

  1. Go to Insert → Shapes
  2. Select a shape (e.g., rectangle)
  3. Draw on worksheet
  4. Right-click shape
  5. Click Assign Macro
  6. Choose macro
  7. Click OK

This method allows better design customization.

Example VBA Macro for Button

Sub ShowMessage()
MsgBox "Report Generated Successfully!"
End Sub

Assign this macro to your button.

Format the Button

You can:

  • Change color
  • Add border
  • Change font
  • Add icon
  • Resize and align

For shapes:
Use Shape Format tab.

Delete or Change Macro Assignment

  • Right-click button
  • Click Assign Macro
  • Select new macro
    OR
  • Click Delete

Best Practices

  • Use clear button names (e.g., Refresh Data)
  • Place buttons at top of dashboard
  • Use consistent colors
  • Avoid too many buttons
  • Lock button position to prevent accidental movement

Form Control vs ActiveX Button

Form ControlActiveX Control
Simple and stableMore customizable
Recommended for beginnersAdvanced use
Works in most casesMore complex properties

Important Note

Save file as:

Excel Macro-Enabled Workbook (.xlsm)

Otherwise macros will not work.

Benefits of Using Buttons

  • Easy automation
  • Professional interface
  • User-friendly dashboards
  • Faster workflow
  • Clean design

Conclusion

Creating Buttons in Excel allows users to run macros with a single click, making automation simple and professional. It enhances usability and is essential for building interactive Excel dashboards and automated systems.

Home » Excel Automation & Power Tools (EAPT) > Introduction to Macros > Creating Buttons