Excel Macro to Paste Values in All Cells in All Worksheets


Use this macro in Excel to convert all of the formulas on all worksheets of a spreadsheet to static values:

Sub Paste() Dim Sh As Worksheet For Each Sh In ThisWorkbook.Worksheets If Sh.Visible = True Then Sh.Activate Sh.Cells.Copy Sh.Range("A1").PasteSpecial Paste:=xlValues Sh.Range("A1").Select End If Next Sh Application.CutCopyMode = False End Sub

Just insert it in a module in Visual Basic, and then go to View . . . Macros . . . View Macros and Run 'Paste'. This macro was posted by Andrew Poulsom to this site:

http://www.mrexcel.com/forum/excel-questions/63213-visual-basic-applications-code-copy-worksheets-paste-values.html