Guest User

Untitled

a guest
Sep 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Sub AsSum()
  2. Dim pf As PivotField
  3. Dim pfvalue As String
  4.  
  5. With Worksheets("pivot").PivotTables("Draaitabel1")
  6. pfvalue = .PivotFields(42).Name
  7.  
  8. *[.. some other code is here]*
  9.  
  10. Worksheets("pivot").PivotTables("Draaitabel1").PivotCache.Refresh
  11.  
  12. .PivotTables("Draaitabel1").PivotField("Product") _
  13. .AutoSort xlDescending, pfvalue
  14. End With
  15.  
  16. End Sub
  17.  
  18. ActiveSheet.PivotTables("Draaitabel1").PivotFields("Product").AutoSort _
  19. xlDescending, ".Qw 32, 2018", ActiveSheet.PivotTables("Draaitabel1"). _
  20. PivotColumnAxis.PivotLines(39), 1
  21.  
  22. Worksheets("pivot").PivotTables("Draaitabel1").PivotCache.Refresh
  23.  
  24. Worksheets("pivot").PivotTables("Draaitabel1").PivotField("Product") _
  25. .AutoSort xlDescending, pfvalue, Worksheets("pivot").PivotColumnAxis.PivotLines(39), 1
  26.  
  27.  
  28. End Sub
Add Comment
Please, Sign In to add comment