Replace Formulas with Values (For The Entire Workbook)

Add to Favorites
Author:
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







Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

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...
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...
Print Entire Workbook in Excel
Macro: This free excel macro allows you to print the entire workbook in Excel. You can easil...
Email the Entire Workbook as a PDF Attachment
: How to convert the entire Excel workbook into a PDF and email it as an attachment....
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.

Tutorial Details
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...
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...
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course