Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88030

.PivotItems.Count - select second to the last entry

$
0
0

For a Pivotchart, I currently use the following code to move a certain value always on top of the chart. Now I would like to use the same for moving another value to the second to last entry (one underneath the very top one).

I've tried something like ".PivotItems(letzterbalken_RC_green).Position = .PivotItems.Count - 1", but I guess the syntax is wrong. Any ideas?

green = Worksheets("Sheet1").Range("C134").Value

With ActiveSheet.PivotTables("PivotTable1").PivotFields("Planungsart")
        .PivotItems(green).Position = .PivotItems.Count
End With

Viewing all articles
Browse latest Browse all 88030

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>