Hi there.
I generate reports for a client each day. They have gone through many iterations, the most recent of which utilizes a PivotTable. The PivotTable exists on its own worksheet (Tab). When my report is complete, I need to copy/paste values and formatting of the entire tab to a new worksheet so as to strip the formulas, etc. To be clear, I do not want a PivotTable in my new file, just the values and formulas of the table and worksheet (which has headers and footers).
I had been using the following VBA macro to accomplish that:
-----
Sub PasteSheetsValues()
Dim w As Worksheet
ActiveWindow.SelectedSheets.Copy
For Each w In ActiveWorkbook.Sheets
With w.UsedRange
.Value = .Value
End With
Next w
End Sub
-----
Unfortunately, now that my worksheet contains a PivotTable, this macro does not work. I receive a Run-time error 1004 ("You cannot move a part of a PivotTable report...).
Complicating matters is my near-complete ignorance of VBA.
Any suggestions?
Thanks!
I generate reports for a client each day. They have gone through many iterations, the most recent of which utilizes a PivotTable. The PivotTable exists on its own worksheet (Tab). When my report is complete, I need to copy/paste values and formatting of the entire tab to a new worksheet so as to strip the formulas, etc. To be clear, I do not want a PivotTable in my new file, just the values and formulas of the table and worksheet (which has headers and footers).
I had been using the following VBA macro to accomplish that:
-----
Sub PasteSheetsValues()
Dim w As Worksheet
ActiveWindow.SelectedSheets.Copy
For Each w In ActiveWorkbook.Sheets
With w.UsedRange
.Value = .Value
End With
Next w
End Sub
-----
Unfortunately, now that my worksheet contains a PivotTable, this macro does not work. I receive a Run-time error 1004 ("You cannot move a part of a PivotTable report...).
Complicating matters is my near-complete ignorance of VBA.
Any suggestions?
Thanks!