Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ComboBox1_Change()
- Dim pt As Pivot Table
- Dim pf As PivotField
- Dim cbo As ComboBox
- Set pt = ActiveSheet.PivotTables("PivotTable1")
- For Each pf In pt.RowsFields
- If pf.Name <> "Values" Then
- pf.Orientation = xlHidden
- End if
- Next pf
- If cbo = "customer" Then
- Activesheet.PivotTables("PivotTable1").PivotFields("Customer").Orientation = xlRowField
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement