Hi guys,
I have a code to create a Pivot table. A piece of the code orders the columns in a specific order, but it used to fail if there wasn't values of some of the items, so I added the "On error resume next" statement. However, it seems not to be working. This is the code:
Any idea why could this be happening?
Thank you
I have a code to create a Pivot table. A piece of the code orders the columns in a specific order, but it used to fail if there wasn't values of some of the items, so I added the "On error resume next" statement. However, it seems not to be working. This is the code:
Code:
On Error Resume Next
With ActiveSheet.PivotTables("Dashboard").PivotFields("Ageing")
.Orientation = xlColumnField
.Position = 1
.PivotItems("Btw 0 and 7 d.").Position = 1
.PivotItems("Btw 8 and 14 d.").Position = 2
.PivotItems("Btw 15 and 30 d.").Position = 3
.PivotItems("Btw 31 and 45 d.").Position = 4
.PivotItems("Btw 46 and 60 d.").Position = 5
.PivotItems("Btw 61 and 90 d.").Position = 6
.PivotItems("More than 90 d.").Position = 7
End With
Any idea why could this be happening?
Thank you