enbw
Technical User
- Mar 13, 2003
- 296
Hi,
I am writing a macro which generates a pivot table from quite large sheet.
I need the macro to move the pivot fields within the pivot table so that a particular item is always last, furtherest to the right. When I generate a macro through excel, recording, it generates the following;
ActiveSheet.PivotTables("PivotTable5").PivotFields(" STATUS ").PivotItems( _
"Budget").Position = 9
Is there a variable such as 'last' to use instead of 9. So there irrespective of the number of items this field is always the last? Such as the option within the pivot table.
Thanks in advance.
I am writing a macro which generates a pivot table from quite large sheet.
I need the macro to move the pivot fields within the pivot table so that a particular item is always last, furtherest to the right. When I generate a macro through excel, recording, it generates the following;
ActiveSheet.PivotTables("PivotTable5").PivotFields(" STATUS ").PivotItems( _
"Budget").Position = 9
Is there a variable such as 'last' to use instead of 9. So there irrespective of the number of items this field is always the last? Such as the option within the pivot table.
Thanks in advance.