We can select the entire Pivot Table by using the special command called TableRange2. The following codes is to select the entire Pivot Table and paste it to another location (like a blank worksheet).

Sub copy_Pivot_Table()

‘Used range is a command readily avaiable in Excel VBA.

‘The code below is to identify and perform a copy of Pivot Table.
‘TableRange2 is a special command that refers to the entire Pivot Table
With Worksheets(“Report”)
End With

With ThisWorkbook.Worksheets(“Sheet1”)
.Range(“A4”).PasteSpecial Paste:=xlPasteAll
.Range(“A4”).PasteSpecial Paste:=xlValues
End With

End Sub

    1 Response to "Select entire Pivot Table using VBA"

    • odιoѕιn™

      thanks a lot very useful 😀

Leave a Reply