Reputation: 805
I am generating a pivot table using VBA in Excel. By default the Report Layout is 'Outline Form'
. How can I change this to 'Compact form'
or 'Tabular Form'
through my code ? Any help is appreciated ! Thanks.
Upvotes: 0
Views: 11375
Reputation: 27478
By running the Macro Recorder I get this code for changing it to Compact:
ActiveSheet.PivotTables("PivotTable1").RowAxisLayout xlCompactRow
To get it into Tabular Form, sure enough:
ActiveSheet.PivotTables("PivotTable1").RowAxisLayout xlTabularRow
Remember, the Macro Recorder is your friend.
Upvotes: 3