VBA & Macro Problems

How to Copy an Excel Worksheet as Values Only Using VBA

Jason MillerJason Miller Nov 10, 2026 868 views

Question details

The user needs to duplicate a worksheet and remove all its formulas, keeping only the static values, either on desktop Excel using VBA or on the web using Office Scripts.

How to Copy an Excel Worksheet as Values Only
Product
Microsoft Excel
Device & OS
not provided
Scenario
Automating the process of creating a static copy of a formula-heavy worksheet for reporting, archiving, or sharing without exposing the underlying calculations.
Observed behavior
A new worksheet is created containing the exact same layout and data as the original, but all formulas are permanently converted to their calculated values.
Before you start

Ensure you have saved a backup of your workbook, as running a macro typically clears your undo history. Also, verify that the Developer tab is enabled to access the VBA Editor.

Solution 1Recommended

Use a VBA Macro in Desktop Excel

Automate copying the active sheet and converting all formulas to values using a VBA macro.

This method is ideal for desktop versions of Excel. By saving the macro to your Personal Macro Workbook, you can run this automation on any open workbook with a single click or keyboard shortcut.

1
Open the VBA Editor

Press Alt + F11 on your keyboard to launch the Microsoft Visual Basic for Applications editor.

2
Insert a New Module

Click on Insert in the top menu, then select Module to create a blank script window.

3
Paste the VBA Code

Paste the macro code that utilizes the ws.Copy After:=ws and wt.UsedRange.Value = wt.UsedRange.Value commands to duplicate the sheet and overwrite formulas.

4
Run the Macro

Close the VBA editor. Go to the Developer tab, click on Macros, select your new CopySheetValues macro, and click Run.

Performance Tip: Using 'Application.ScreenUpdating = False' at the beginning of your macro speeds up the execution process by preventing Excel from redrawing the screen while the sheet is being copied.
Efficient Data Management with WPS Office

Run Macros to Convert Formulas to Values in WPS Spreadsheet

WPS Office provides robust VBA support, allowing you to run macros to duplicate sheets and convert formulas to values seamlessly. It is a highly efficient alternative for managing complex spreadsheet tasks.

  1. 1. Open Your Workbook: Launch WPS Spreadsheet and open the file containing the formulas you wish to convert.
  2. 2. Access Developer Tools: Navigate to the Tools tab on the ribbon and click on 'Developer' to access the macro features.
  3. 3. Insert the Macro Code: Click 'Macros' or open the VBA Editor, insert a new module, and paste your formula-to-values macro code.
  4. 4. Execute the Automation: Save the module and click 'Run'. WPS will instantly create a duplicated worksheet containing only the static values.
Fully compatible with Microsoft Excel .xls, .xlsx, and .xlsm macro formatsBuilt-in Developer tools with a comprehensive VBA editorFree and lightweight alternative to Microsoft OfficeFamiliar ribbon interface ensures zero learning curve
microsoft office alternative - wps office

Frequently Asked Questions

Can I undo a macro that converts formulas to values?

No, actions performed by a VBA macro usually clear the Excel undo stack. It is strongly recommended to save a backup of your workbook before running any script that overwrites formulas.

How do I make the VBA macro available in all my workbooks?

You can store the macro in your Personal Macro Workbook (Personal.xlsb). This is a hidden workbook that opens automatically in the background every time you start the application, making its macros accessible globally.

How do I assign this macro to a shortcut or button?

You can assign the macro to a button by right-clicking the Quick Access Toolbar, selecting 'Customize Quick Access Toolbar', choosing 'Macros' from the drop-down list, and adding your macro to the toolbar.

Why should I use Office Scripts instead of VBA?

Office Scripts are designed specifically for Excel on the web and cloud-based workflows. Unlike VBA, which only runs on desktop applications, Office Scripts can be triggered remotely via Power Automate and run across different platforms.