_______________________________________
Sub EditPasteValues()
' I'll want to return to the current worksheet
' when this is done, so I'll save its info for
' future reference:
Dim CurrentSheet As Excel.Worksheet
Set CurrentSheet = ActiveSheet
Dim Sheet As Excel.Worksheet
Dim CurrentWindow As Window
' Here, I'll cycle through each of the worksheets,
' performing the select all cells, copy all cells,
' Edit / Paste Special / Values so that any formulas
' are wiped out and only the final values remain
For Each Sheet In Excel.Worksheets
If TypeName(Sheet) = "Worksheet" Then
Sheet.Activate
Set CurrentWindow = ActiveWindow
Application.Goto Reference:="R1C1"
Cells.Select
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select
End If
Next Sheet
' Here I'm returning to the original worksheet
' that I saved above
CurrentSheet.Activate
End Sub
_______________________________________
No comments:
Post a Comment