Replace Formulas with Values (For The Entire Workbook)

Add to Favorites
This macro will convert every formula in an entire workbook into its respective value. This is basically a quick way to replace to do a copy-paste values except that nothing is moved or re-arranged. Just make sure to remember that this one will not only work on the active sheet, but on the entire open workbook. This is a good thing to use if you are distributing your workbook and you don't want the recipients to know how you did something or where certain numbers came from.

Where to install the macro:  Module

Replace Formulas with Values (Entire Workbook)

Sub FormulasToValues_EntireWorkbook()

'This Macro will replace all formulas from an entire workbook
'with their respective values. It will just changes all
'formulas to values.

WCount = Worksheets.Count
For i = 1 To WCount
If Worksheets(WCount - i + 1).Visible Then
Worksheets(WCount - i + 1).Select
RCount = ActiveCell.SpecialCells(xlLastCell).Row
CCount = ActiveCell.SpecialCells(xlLastCell).Column
For j = 1 To RCount
For k = 1 To CCount
Worksheets(WCount - i + 1).Cells(j, k) = Worksheets(WCount - i + 1).Cells(j, k).Value
Next k
Next j
End If
Next i

End Sub







Similar Content on TeachExcel
Print Preview Screen Display for The Entire Workbook in Excel
Macro: This free Excel macro allows you to quickly and easily display the print preview windo...
Vlookup Function That Searches The Entire Workbook - UDF
Macro: This UDF is a Vlookup function that searches the entire workbook in Excel. The syntax...
Print Entire Workbook in Excel
Macro: This free excel macro allows you to print the entire workbook in Excel. You can easil...
Using Formulas with Tables in Excel
Tutorial: Easy way to reference data tables and make formulas within a data table. This allows you ...
Stop Formula Calculation in Excel - Increase Worksheet Performance
Tutorial: I'll show you how to stop formulas and functions from performing their calculations and u...
List all Conditional Formatting Formulas in Excel
Tutorial: List all conditional formatting formulas in a worksheet in Excel. This allows you to quick...



How to Install the Macro
  1. Select and copy the text from within the grey box above.

  2. Open the Microsoft Excel file in which you would like the Macro to function.

  3. Press "Alt + F11" - This will open the Visual Basic Editor - Works for all Excel Versions.  Or For other ways to get there, Click Here.

  4. On the new window that opens up, go to the left side where the vertical pane is located. Locate your Excel file; it will be called VBAProject (YOUR FILE'S NAME HERE) and click this.

  5. If the Macro goes in a Module, Click Here, otherwise continue to Step 8.

  6. If the Macro goes in the Workbook or ThisWorkbook, Click Here, otherwise continue to Step 8.

  7. If the Macro goes in the Worksheet Code, Click Here, otherwise continue to Step 8.

  8. Close the Microsoft Visual Basic Editor window and save the Excel file. When you close the Visual Basic Editor window, the regular Excel window will not close.

  9. You are now ready to run the macro.


Similar Content
Print Preview Screen Display for The Entire Workbook in Excel
Macro: This free Excel macro allows you to quickly and easily display the print preview windo...
Vlookup Function That Searches The Entire Workbook - UDF
Macro: This UDF is a Vlookup function that searches the entire workbook in Excel. The syntax...
Print Entire Workbook in Excel
Macro: This free excel macro allows you to print the entire workbook in Excel. You can easil...
Excel Forum