I’m having trouble getting pivot table formats to copy to a new sheet. Basically what I’m trying to do is this:
someRange.Copy
someOtherRange.pasteSpecial xlPasteValues
someOtherRange.pasteSpecial xlPasteFormats
Basically, I want an exact copy of the current view on a pivot table in a new sheet but I just want the values and formatting (and not be connected to the pivot table any longer). Doing this procedure by hand produces the correct result, but for some reason the formatting doesn’t copy when I use the same approach via vba… Thoughts?
Update:
Exact code as requested:
Application.CutCopyMode = False
pivotSheet.Range(pivotSheet.usedRange.Cells(1, 2), pivotSheet.Cells(pivotSheet.usedRange.Rows.Count, pivotSheet.Columns.Count)).Copy
updatesSheet.Range(updatesSheet.Cells(1, 1), updatesSheet.Cells(pivotSheet.usedRange.Rows.Count, pivotSheet.usedRange.Columns.Count)).PasteSpecial xlPasteValues
updatesSheet.Range(updatesSheet.Cells(1, 1), updatesSheet.Cells(pivotSheet.usedRange.Rows.Count, pivotSheet.usedRange.Columns.Count)).PasteSpecial xlPasteFormats
Application.CutCopyMode = False
TRIED AND TESTED
SNAPSHOT