Prevent Users from Editing Formulas on a Protected WPS Spreadsheet Worksheet
Question details
The user needs to prevent formula cells from being edited after worksheet protection is applied, including after repeated double-clicks appear to make locked formula cells editable.

- Product
- WPS Office Spreadsheets
- Device & OS
- not provided
- Scenario
- The user manages a shared workbook and wants formula cells to remain read-only for other users.
- Observed behavior
- On a protected worksheet, locked formula cells can still become editable after repeated double-clicks, allowing unauthorized formula changes.
Open the workbook in WPS Office Spreadsheets and confirm that you have permission to change worksheet protection and macro settings. If you plan to use VBA, save the file in a macro-enabled format and enable macros when prompted.
Lock formula cells and protect the worksheet in WPS Office Spreadsheets
Use this method first because it applies built-in worksheet protection that keeps formula cells read-only for most users.
Press Ctrl+A to select the entire sheet, right-click any selected cell, and choose Format Cells.
On the Protection tab, clear Locked and click OK. Then click Home > Find & Select > Go To Special, choose Formulas, click OK, right-click a selected formula cell, choose Format Cells > Protection, and check Locked.
Click Review > Protect Sheet, enter a password if needed, and under Allow all users of this worksheet to, leave only Select locked cells and Select unlocked cells checked.
Save the workbook and try editing a formula cell as another user would. If editing is blocked, the built-in protection is active.

Add a Worksheet_Change macro to undo unauthorized formula edits
Use this event-based safeguard when formula cells still become editable after repeated double-clicks, or when you need an extra layer of control.
Protect Formula Cells in WPS Office Spreadsheets Without Rebuilding Your Excel Workbook
Open your Excel workbook in WPS Office Spreadsheets, lock formula cells, protect the worksheet, and optionally add a Worksheet_Change macro to undo unexpected edits while keeping full Excel compatibility.
- 1. Open the workbook in WPS Office Spreadsheets: Launch WPS Office, click Open, and select the .xlsx or .xlsm file you need to protect.
- 2. Select and lock formula cells: Press Ctrl+A, right-click and choose Format Cells > Protection, clear Locked, click OK; then use Home > Find & Select > Go To Special > Formulas, right-click a selected formula cell and check Locked.
- 3. Protect the worksheet: Click Review > Protect Sheet, set a password, and allow only Select locked cells and Select unlocked cells.
- 4. Optionally add the VBA undo safeguard: Press Alt+F11, double-click the sheet module, and paste the Worksheet_Change code that runs Application.Undo when Target.Locked is True.
- 5. Save and test the result: Save the workbook in macro-enabled format if macros are used, then test editing and double-clicking formula cells to confirm the protection works.

Frequently Asked Questions
Why do locked formula cells become editable after double-clicking on a protected Excel worksheet?
This can happen because of unexpected Excel or WPS behavior that bypasses normal edit blocking after repeated double-clicks. Locking formula cells and protecting the worksheet helps, and a Worksheet_Change Application.Undo macro can reverse unintended edits.
Does WPS Office support worksheet protection and VBA macros in Excel files?
Yes. WPS Office Spreadsheets supports cell locking, sheet protection, and VBA macros in compatible versions. Save the workbook in a macro-enabled format such as .xlsm if you use VBA.
How do I select only formula cells in WPS Office Spreadsheets?
Click Home > Find & Select > Go To Special, choose Formulas, and click OK. Then right-click a selected formula cell, choose Format Cells > Protection, and check Locked.
Will an Application.Undo macro make a protected worksheet completely secure?
No. The macro only reverses edits after they occur and will not run if macros are disabled. Use it as a practical safeguard together with sheet protection, passwords, and access controls.




