VBA & Macro Problems

Fix an Excel VBA Macro to Copy Formula Results as Values

Muhammad TalhaMuhammad Talha Dec 2, 2026 868 views

Question details

Copy the calculated result of a formula to another cell as a value using a VBA macro.

Fix an Excel VBA Macro to Copy Formula Results as Values
Product
Microsoft Excel VBA
Device & OS
not provided
Scenario
A macro needs to transfer the result of a formula in K5 to L15 without copying the formula.
Observed behavior
The existing copy-and-paste macro does not produce the intended value when the source cell contains a formula.
Before you start

Open the workbook in desktop Excel and identify the source and destination cells. Make sure the workbook is trusted and macros are enabled, and recalculate the worksheet if the formula result may be outdated.

Solution 1Recommended

Assign the Formula Result Directly in VBA

Use direct cell assignment to transfer the calculated result without the clipboard or a second paste command.

The Value2 property reads the formula's current result rather than the formula itself. Unqualified Range references use the active sheet, so specify a worksheet if the macro must run on a particular sheet.

1
Open the VBA editor

In desktop Excel, press Alt+F11, then open the module containing the existing macro or select Insert > Module.

2
Replace the copy-and-paste code

Use this macro, adjusting the cell references as needed: Sub CopyValue() Range("L15").Value = Range("K5").Value2 End Sub

3
Run and check the macro

Return to Excel, select Developer > Macros, choose CopyValue, and click Run. Check that L15 contains the result from K5 as a value rather than a formula.

4
Save the macro

Select File > Save As and choose Excel Macro-Enabled Workbook (*.xlsm) to retain the VBA code.

Assign the Formula Result Directly in VBA
Check calculation and source errors: If calculation is set to manual, recalculate before running the macro. If K5 currently displays an Excel error, the assignment transfers that error value.
Free Microsoft Office alternative

Copy Formula Results as Values in WPS Spreadsheets

WPS Office is a free, lightweight Office alternative with a familiar interface and Microsoft Office format compatibility for an easy transition. WPS Spreadsheets can paste formula results as values, though it does not repair an Excel VBA macro.

Copy a formula result and use Paste Special to paste it as a valueOpen and edit Microsoft Excel XLSX filesWork in a familiar spreadsheet interfaceUse a free, lightweight Office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why use Value2 instead of copying and pasting?

Range("K5").Value2 reads the cell's calculated result directly, so assigning it to L15 avoids the clipboard and does not copy the formula.

How do I make sure the macro uses the right worksheet?

Qualify both ranges with the worksheet, for example: Worksheets("Sheet1").Range("L15").Value = Worksheets("Sheet1").Range("K5").Value2. Replace Sheet1 with the actual sheet name.

Why does the destination show an old result?

The formula may not have recalculated. In Excel, use Formulas > Calculate Now, then run the macro again.

Can I paste a formula result as a value without VBA?

Yes. Copy the formula cell, select the destination, and use Home > Paste > Values in Excel. In WPS Spreadsheets, use Paste Special and select Values.