13
I am trying to use the code to select all the rows under one of the subheaders in a pivot table. I am getting a run time error 1004:
Unable to get the PivotFields property of the Pivot Table class
From this code:
Sub ttest()
Dim pt As PivotTable
Set pt = Sheets("Report").PivotTables("PivotTable1")
pt.PivotFields("Row Labels").PivotItems("CL").DataRange.Select
End Sub
Why?