I am receiving a compile error: Else without IF but can't see the error?
Sub ByRegionCategory()
' Display by Region and category
Application.ScreenUpdating = False
If Range("Trigger1") = True Then
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Detail").Orientation = _
xlHidden
.PivotFields ("Region")
.Orientation = xlRowField
.Position = 1
.PivotFields ("Category")
.Orientation = xlRowField
.Position = 2
ElseIf Range("Trigger1") = False Then
ActiveSheet.PivotTables("PivotTable1").PivotFields("Detail").Orientation = _
xlHidden
With ActiveSheet.PivotTables("PivotTable1").PivotFields("Category")
.Orientation = xlRowField
.Position = 1
.PivotFields ("Region")
.Orientation = xlRowField
.Position = 2
End If
End Sub
Thanks in advance
Bookmarks