Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub AsSum()
- Dim pf As PivotField
- Dim pfvalue As String
- With Worksheets("pivot").PivotTables("Draaitabel1")
- pfvalue = .PivotFields(42).Name
- *[.. some other code is here]*
- Worksheets("pivot").PivotTables("Draaitabel1").PivotCache.Refresh
- .PivotTables("Draaitabel1").PivotField("Product") _
- .AutoSort xlDescending, pfvalue
- End With
- End Sub
- ActiveSheet.PivotTables("Draaitabel1").PivotFields("Product").AutoSort _
- xlDescending, ".Qw 32, 2018", ActiveSheet.PivotTables("Draaitabel1"). _
- PivotColumnAxis.PivotLines(39), 1
- Worksheets("pivot").PivotTables("Draaitabel1").PivotCache.Refresh
- Worksheets("pivot").PivotTables("Draaitabel1").PivotField("Product") _
- .AutoSort xlDescending, pfvalue, Worksheets("pivot").PivotColumnAxis.PivotLines(39), 1
- End Sub
Add Comment
Please, Sign In to add comment