Eckerslike
New Member
- Joined
- Jul 4, 2008
- Messages
- 2
Hi,
I have a pivot table that has data for a few years with the columns being the years, what I want to do is sort the data by the column that has 2008 in it, if you use the automatic sort is sums all the years together and effectively sorts by the Grand Total and not the latest year.
I have created a Macro that sorts the data as I would like it and I have assigned that to a button and it works fine.
What I am trying to do is use the Worksheet_PivotTableUpdate to run that macro so that the user does not have to click the button everytime they select something different.
The problem that I have is that when the macro runs it updates the pivot table, so it then creates a continous loop.
Does anyone know a way round this issue, so that it only runs once each time the user changes the selection criteria.
Thanks in advance.
I have a pivot table that has data for a few years with the columns being the years, what I want to do is sort the data by the column that has 2008 in it, if you use the automatic sort is sums all the years together and effectively sorts by the Grand Total and not the latest year.
I have created a Macro that sorts the data as I would like it and I have assigned that to a button and it works fine.
What I am trying to do is use the Worksheet_PivotTableUpdate to run that macro so that the user does not have to click the button everytime they select something different.
The problem that I have is that when the macro runs it updates the pivot table, so it then creates a continous loop.
Does anyone know a way round this issue, so that it only runs once each time the user changes the selection criteria.
Thanks in advance.