VBA & Macro Problems

How to Reset a WPS Spreadsheet Workbook to Its Original State with VBA

Aamir Naveed AkramAamir Naveed Akram Nov 13, 2026 870 views

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.

Reset a WPS Spreadsheet Workbook to Its Original State with VBA
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 start

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.

Solution 1Recommended

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.

1
Open the Visual Basic Editor

In WPS Spreadsheet, click the Developer tab and select Visual Basic Editor, or press Alt+F11 to open the macro editing window.

2
Insert a module

In the Project pane, right-click the workbook project and choose Insert > Module to create a new module.

3
Paste the reset code

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

4
Run the macro

Return to the workbook, click Developer > Macros, select ResetWorkbook, and click Run to clear the defined input range.

Create a VBA Macro to Clear Input Cells and Restore Saved Values in WPS Spreadsheet
Reset completed: After running the macro, save the workbook under a new name if you need to keep the pre-reset version for comparison or audit.
WPS Spreadsheet VBA Macro Guide

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. 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. 2. Open the VBA editor: Click Developer > Visual Basic Editor or press Alt+F11 to create a reset module.
  3. 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. 4. Run and verify: Click Developer > Macros, select your reset macro, then click Run and review the restored cells or sheets.
Built-in VBA editor and Developer tab for creating reset macrosOpens and saves .xlsm and .xls files while preserving macro compatibilityFree and lightweight Office-compatible spreadsheet toolFamiliar ribbon and macro workflow reduces re-learning time
QA img-9

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.