Hi there,
I need help with the following pivot code please. The pivot items "ACC", "FRY", "INS" qnd "OTH" may or may not appear in my range. The problem is that that macro halts if any of the items are not in the range. Is it possible to use an IF instruction to allow for the possibility of the item not being in the range?
Or is there some alternative way to instruct the pivot?
Thanks in advance.
I need help with the following pivot code please. The pivot items "ACC", "FRY", "INS" qnd "OTH" may or may not appear in my range. The problem is that that macro halts if any of the items are not in the range. Is it possible to use an IF instruction to allow for the possibility of the item not being in the range?
Or is there some alternative way to instruct the pivot?
Thanks in advance.
HTML Code:
ActiveSheet.PivotTables("PivotTable8").AddDataField ActiveSheet.PivotTables( _
"PivotTable8").PivotFields("AGENT COMM EUR"), "Sum of AGENT COMM EUR", xlSum
ActiveSheet.PivotTables("PivotTable8").AddDataField ActiveSheet.PivotTables( _
"PivotTable8").PivotFields("TOTAL PRC EUR"), "Sum of TOTAL PRC EUR", xlSum
ActiveSheet.PivotTables("PivotTable8").PivotFields("REC_TYPE").CurrentPage = _
"(All)"
With ActiveSheet.PivotTables("PivotTable8").PivotFields("REC_TYPE")
.PivotItems("ACC").Visible = False
.PivotItems("FRY").Visible = False
.PivotItems("INS").Visible = False
.PivotItems("OTH").Visible = False