SHARE
TWEET

Untitled

a guest Jun 25th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub ComboBox1_Change()
  2. Dim pt As Pivot Table
  3. Dim pf As PivotField
  4. Dim cbo As ComboBox
  5.  
  6. Set pt = ActiveSheet.PivotTables("PivotTable1")
  7.  
  8. For Each pf In pt.RowsFields
  9.    If pf.Name <> "Values" Then
  10.         pf.Orientation = xlHidden
  11.    End if
  12. Next pf
  13. If cbo = "customer" Then
  14.  
  15.  
  16. Activesheet.PivotTables("PivotTable1").PivotFields("Customer").Orientation = xlRowField
  17.  
  18. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top