Reputation: 275
I am trying to select all the rows under a specific row label but with my code I am only able to select the first Row under each row label. Any suggestions would be greatly appreciated, here is my code.
Sub ttest()
Dim pt As PivotTable
Set pt = Sheets("Report").PivotTables("PivotTable1")
pt.PivotFields("Pillar").PivotItems("CL").DataRange.EntireRow.Select
End Sub
Upvotes: 0
Views: 4359
Reputation: 805
You can use this code to copy the rows. Should work on your existing set of code:
PT.PivotSelect "'CL' Rows[All]", xlDataAndLabel + xlFirstRow, True
Copied through Macro Recorder.
Edit: You can always use offset to edit the current selection. I mean to increase or decrease number of selected rows.
Thanks, V
Upvotes: 1