VBA & Macro Problems

Replace Formulas with Values in an Excel Table Column Using VBA

Olivia MillerOlivia Miller Dec 2, 2026 869 views

Question details

Replace formulas with their current values in an Excel table column without looping through individual cells.

Replace Formulas with Values in an Excel Table Column Using VBA
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants a VBA macro to update an entire table column in one operation.
Observed behavior
The column should retain the current formula results as values rather than formulas.
Before you start

Identify the worksheet code name, table name, and column name, and confirm that the formulas show the results you want to keep. If the workbook uses change events, check that their handlers can process a multi-cell target.

Solution 1Recommended

Assign the Excel table column's values to itself

Use one range assignment to replace formulas with their current results across the table column.

1
Open the VBA editor

In Excel, press Alt+F11, then select Insert > Module.

2
Add the macro

Paste the following code into the module: Sub UpdateCells() On Error GoTo ErrorHandler Application.ScreenUpdating = False With Sheet1.Range("DataBase[status]") .Value = .Value End With Application.ScreenUpdating = True MsgBox "Done updating cells" Exit Sub ErrorHandler: Application.ScreenUpdating = True MsgBox "Update failed: " & Err.Description, vbExclamation End Sub

3
Set the worksheet and column

Replace Sheet1 with the worksheet's VBA code name and replace DataBase and status with your table and column names. The structured reference targets the column's data cells, not its header.

4
Run and check the result

Return to Excel, press Alt+F8, select UpdateCells, and click Run. Select a previously calculated cell and check the formula bar to confirm it now contains a value.

Assign the Excel table column's values to itself
Check change-event handlers: The assignment can trigger a worksheet change event with a multi-cell Target. Ensure any handler can process a range rather than assuming only one cell changed.
Convert formulas to values

Replace spreadsheet formulas with values in WPS Office

In WPS Spreadsheets, use Paste Special to replace a selected column's formulas with their displayed results without processing cells individually. This is a manual alternative, not an Excel VBA macro.

  1. 1. Open the workbook: Open your spreadsheet in WPS Spreadsheets and navigate to the table column.
  2. 2. Select the data cells: Select the cells containing the formulas to convert, excluding the header and any totals row.
  3. 3. Copy the selection: Press Ctrl+C or select Copy on the Home tab.
  4. 4. Paste values: With the same cells selected, open the Home tab's Paste menu, choose Paste Special, and select Values. Check a converted cell in the formula bar.
Convert a selected range of formulas to values in one operationOpen and edit Microsoft Excel XLSX workbooksUse familiar spreadsheet copy and paste controls
microsoft office alternative - wps office

Frequently Asked Questions

Does the VBA assignment change the table header?

No. The structured reference DataBase[status] targets the data cells in that table column, not the header.

Do I need to calculate the formulas before running the macro?

Make sure the displayed results are current before running it. If needed, press F9 in Excel to recalculate, then run the macro.

Why might a worksheet change event cause an error?

The assignment can raise a change event for the entire column range. Check the worksheet's Worksheet_Change code in the VBA editor and make sure it handles a multi-cell Target.

Can I replace formulas with values without VBA?

Yes. Select the data cells, copy them, and use Paste Special > Values on the same selection in Excel or WPS Spreadsheets.