VBA & Macro Problems

How to Fix Excel Macro Button Doing Nothing When Clicked

Natalie TaylorNatalie Taylor Nov 2, 2026 869 views

Question details

The user has an Excel macro that successfully runs in the Visual Basic Editor but does nothing when triggered via its assigned worksheet button.

How to Fix Excel Macro Button Doing Nothing When Clicked
Product
Excel
Device & OS
not provided
Scenario
The user is attempting to execute a verified macro by clicking a designated form control button in their spreadsheet.
Observed behavior
Clicking the button produces no action or error message. Upon checking the Assign Macro dialog, the macro name contains an incorrect trailing suffix (such as '.Split_Sheets').
Before you start

Before proceeding, verify that macros are fully enabled in your spreadsheet's Trust Center settings and double-check that the macro script executes correctly when run directly from the Visual Basic Editor (VBE).

Solution 1Recommended

Remove Suffixes and Reassign the Macro

This solution directly fixes the broken link between the worksheet button and the VBA script by removing any erroneous text appended to the macro name in the assignment settings.

When a macro is renamed, or under certain copying conditions, the button's assigned macro name may gain an unexpected suffix (like '.Split_Sheets'). Because the exact name no longer matches the script in the VBA editor, clicking the button does nothing.

1
Right-click the unresponsive button

Navigate to your worksheet and right-click on the macro button that is not working. Avoid left-clicking so you do not accidentally attempt to trigger it.

2
Open the Assign Macro dialog

From the context menu that appears, click on 'Assign Macro...' to open the assignment settings window.

3
Delete the incorrect suffix

Look at the 'Macro name' text box at the top of the dialog. Delete any extra text or trailing suffixes (e.g., '.Split_Sheets') so only the original macro name remains.

4
Select the correct macro

Alternatively, scroll through the list of available macros in the box below, click the exact correct macro name to highlight it, and ensure it updates the top text box.

5
Confirm and test

Click 'OK' to save your changes. Click any empty cell to deselect the button, then left-click the button to test if the macro runs successfully.

Remove Suffixes and Reassign the Macro
Macro Reassigned Successfully: Once the macro name exactly matches the subroutine in your Visual Basic Editor without extra suffixes, the button will instantly execute the script.

Easily Manage and Run Macros with WPS Spreadsheet

WPS Spreadsheet provides comprehensive support for VBA macros, allowing you to easily assign, manage, and execute your scripts with form control buttons exactly as you would in Microsoft Excel.

  1. 1. Open your macro-enabled file: Launch WPS Spreadsheet and open your existing .xlsm file containing the VBA scripts.
  2. 2. Access the Developer Tab: Navigate to the 'Developer' tab on the top ribbon. If it is not visible, enable it from the WPS settings.
  3. 3. Insert a Form Control: Click 'Insert' and select a Button from the Form Controls menu, then draw it onto your worksheet.
  4. 4. Assign the Macro: The 'Assign Macro' dialog will appear automatically. Select the exact macro name from your list, ensure there are no extra suffixes, and click 'OK'.
Seamless compatibility with Microsoft Excel (.xlsm) macro-enabled file formats.Built-in Visual Basic Editor for writing, editing, and debugging VBA scripts.Intuitive developer tools to insert form controls and assign macros effortlessly.Lightweight program size that ensures fast execution of complex VBA tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my macro run in the VBA Editor but not from the worksheet button?

This generally happens when the button is pointing to an outdated or incorrect macro name. If the macro was renamed, or if an extra string of text (like a sheet name suffix) was appended to the assignment, the button cannot find the correct script. Correcting the name in the 'Assign Macro' dialog resolves this.

How do I fix a button that says 'Cannot run the macro'?

If you receive this error, either the macro has been deleted, macros are disabled in your Trust Center settings, or the macro is in a different workbook that is currently closed. Ensure macros are enabled and reassign the macro to the button using the exact subroutine name.

Can I assign a macro to a shape instead of a standard form button?

Yes. You can insert any shape via the Insert tab, right-click the shape, and select 'Assign Macro'. The troubleshooting steps for fixing unresponsive shape buttons are exactly the same as for standard form control buttons.