How to Reset a WPS Spreadsheet Workbook to Its Original State with VBA
Question details
The user wants to use VBA in WPS Spreadsheet to reset a workbook to a defined initial state, such as cleared input data, a restored template, or reverted saved values.

- Product
- WPS Office Spreadsheet
- Device & OS
- not provided
- Scenario
- A user has a WPS Spreadsheet workbook that has been changed and wants to use VBA to return it to a starting condition, such as a clean template, original saved values, or cleared input areas.
- Observed behavior
- The workbook does not automatically remember its initial state; the reset requirements must be defined and applied through a macro.
Before you write or run a reset macro, open the WPS Spreadsheet Visual Basic Editor with Alt+F11, list the sheets, ranges, formulas, formatting, and objects that must be restored, and save a timestamped copy of the workbook so you can compare the result after testing.
Create a VBA Macro to Clear Input Cells and Restore Saved Values in WPS Spreadsheet
Use this method when only specific input ranges or selected values should be reset, while formulas and structure remain intact.
This is the safest reset approach because it changes only the ranges you explicitly include in the macro. Formulas, formatting, and layout outside those ranges stay untouched.
In WPS Spreadsheet, click the Developer tab and select Visual Basic Editor, or press Alt+F11 to open the macro editing window.
In the Project pane, right-click the workbook project and choose Insert > Module to create a new module.
In the module window, enter a Sub procedure that restores saved values or clears the target input ranges, for example: Sub ResetWorkbook() Worksheets("Sheet1").Range("B2:D20").ClearContents End Sub
Return to the workbook, click Developer > Macros, select ResetWorkbook, and click Run to clear the defined input range.

Restore a Full Workbook by Copying the Original Template Sheet with VBA
Use this when an entire worksheet must be restored to a saved layout, including formatting, formulas, and objects.
Reset WPS Spreadsheet Workbooks with VBA Macros
WPS Spreadsheet lets you create and run VBA reset macros directly in a familiar Excel-compatible interface, so you can clear input cells, restore template sheets, or revert saved values without leaving the workbook.
- 1. Enable the Developer tab: In WPS Spreadsheet, open the File menu, choose Options, click Customize Ribbon, and tick Developer to show the macro tools.
- 2. Open the VBA editor: Click Developer > Visual Basic Editor or press Alt+F11 to create a reset module.
- 3. Write the reset macro: Insert a module and type a Sub procedure that clears your chosen input ranges or restores saved template values.
- 4. Run and verify: Click Developer > Macros, select your reset macro, then click Run and review the restored cells or sheets.

Frequently Asked Questions
Does WPS Spreadsheet support VBA macros for resetting a workbook?
Yes. WPS Spreadsheet includes a Developer tab and Visual Basic Editor. You can create a macro that clears input cells, restores template values, or copies an original sheet.
Can a reset macro automatically remember the workbook's original state?
No. A workbook does not automatically remember the state in which it was opened or created. You must define the original ranges, sheets, formulas, or objects in the macro or keep a saved template.
How do I prevent a reset macro from deleting important formulas?
Keep the reset range limited to input cells. In the macro, specify only the range to clear, such as Range("B2:D20").ClearContents, instead of clearing the entire worksheet.
Where do I run a reset macro in WPS Spreadsheet?
Click the Developer tab, open Macros, select the macro name, and choose Run. You can also run the macro from the Visual Basic Editor by pressing F5.




