Hi guys,

I have a pivot table that is used as a report.

I would like to use a piece of VBA code to print the active range of the Pivot Table.

Say I have 4 columns of data in the pivot table at the time of printing,I would like it just to print those 4 columns.


Currently my code prints the whole pivot table including several columns of blank data.

I do not want to hide the columns which solves the problem, as when using the pivot table, I want the user to have the options to manipulate the table and add/remove columns based on the field list option.


Sub printpivot()
With ActiveSheet
    .PageSetup.PrintArea = .PivotTables(1).TableRange2.Address
    
End With
Application.Dialogs(xlDialogPrint).Show
End Sub