I want to put some light code on a pivot table that expands / collapses detail.
The command to show / hide the detail works but I get an error on the IF statement:
"application or object defined error".
I suspect there's a problem with my syntax - any ideas?
If ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = False Then
ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = True
Else
ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = False
The command to show / hide the detail works but I get an error on the IF statement:
"application or object defined error".
I suspect there's a problem with my syntax - any ideas?
If ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = False Then
ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = True
Else
ActiveSheet.PivotTables("Mgr_Fcst_Plan_FTE1").PivotFields("Project Name").ShowDetail = False