VBA & Macro Problems

How to Make VBA Radio Buttons Work on a Protected Excel Worksheet

Jason MillerJason Miller Oct 26, 2026 869 views

Question details

The user needs to ensure VBA-controlled radio buttons function correctly when an Excel worksheet is protected.

How to Make VBA Radio Buttons Work on a Protected Excel Worksheet
Product
Excel
Device & OS
not provided
Scenario
Clicking or triggering ActiveX radio buttons (option buttons) via VBA macros on a locked and protected Excel worksheet.
Observed behavior
The radio buttons stop working or trigger VBA runtime errors because the controls are locked, or the macro is protecting/unprotecting the wrong worksheet before modifying rows.
Before you start

Before making changes, create a backup copy of your workbook to prevent data loss during macro testing, and make sure you have the password used to protect the worksheet.

Solution 1Recommended

Unlock the ActiveX Radio Button Control

Prevent the worksheet protection from locking the radio button by modifying its control properties so users can still click it.

By default, all cells and objects in Excel are marked as 'Locked', which takes effect once the worksheet is protected. Unlocking the specific radio button allows interaction even when the sheet is protected.

1
Unprotect the worksheet

Go to the 'Review' tab on the Excel ribbon and click 'Unprotect Sheet'. Enter your password if prompted.

2
Enable Design Mode

Navigate to the 'Developer' tab and click 'Design Mode' so you can select and edit ActiveX controls without triggering their macros.

3
Open Format Control

Right-click the problematic radio button (option button) and select 'Format Control' or 'Properties' from the context menu.

4
Clear the Locked status

In the Format Control dialog, go to the 'Protection' tab, clear the 'Locked' check box, and click 'OK'.

5
Re-protect the worksheet

Turn off 'Design Mode' in the Developer tab, then go back to the 'Review' tab and click 'Protect Sheet' to reapply your security settings.

Unlock the ActiveX Radio Button Control
Test the Button: Click the radio button to ensure it now toggles correctly without triggering a protection error.
Powerful Excel Alternative with VBA Support

Easily Manage Macros and Form Controls with WPS Spreadsheet

WPS Office offers a highly compatible Spreadsheet application that seamlessly supports VBA macros, ActiveX controls, and worksheet protection, making it effortless to troubleshoot and run customized forms.

  1. 1. Download and Install WPS Office: Get WPS Office from the official website and open your .xlsm file in WPS Spreadsheet.
  2. 2. Access Developer Tools: Navigate to the 'Developer' tab to access the VBA Editor, Design Mode, and Form Controls.
  3. 3. Manage Worksheet Protection: Use the 'Review' tab to easily protect or unprotect your worksheet while testing your interactive radio buttons.
High compatibility with Microsoft Excel formats, including macro-enabled .xlsm and .xls files.Robust built-in support for VBA macros and ActiveX form controls.Intuitive developer tools for managing worksheet protection effortlessly.Lightweight, fast-loading, and free alternative to MS Office.
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel macros fail when the worksheet is protected?

When a worksheet is protected, locked cells and objects cannot be modified. If your macro attempts to change locked cells (like hiding rows) or interact with locked controls without unprotecting the sheet first, Excel triggers a runtime error.

Can I allow macros to run on a protected sheet without unprotecting it?

Yes, you can use the `UserInterfaceOnly:=True` argument when applying worksheet protection via VBA upon opening the workbook. This allows macros to make changes seamlessly while keeping the user interface locked for manual edits.

Where do I find the Developer tab to edit ActiveX radio buttons?

If the Developer tab is hidden, go to File > Options > Customize Ribbon. Check the box next to 'Developer' in the right pane and click OK. This will reveal the tab, giving you access to Design Mode and VBA properties.