ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table Refresh VBA Event (https://www.excelbanter.com/excel-programming/278870-re-pivot-table-refresh-vba-event.html)

keepITcool

Pivot Table Refresh VBA Event
 
Brian,


Sorting:
You can control the pivot's sorting by setting the Advanced Options in
the Field Settings for each row-, column- or page field.

AddingRows to source automatically:
Define a name for the table on which the Pivot is based, AND have that
name use a dynamic formula to include allrows/columns.
Name: dnPivotsource
RefersTo: =Offset(Sheet2!$a$1;0;0;counta($a:$a);counta($1:$1 ))

Next: backclick in the PivotWizard to change the Pivot's source
replace the range adddress with the =dnPivotSource 9use [F3] to list
available names.

Now a simple refresh is enough to update the Pivot if you've added some
rows.



cheerz!


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"brian" wrote:

Hello,

I have a pivot table with auto-refresh when the workbook
is opened. If I add a new row to my source table, the
pivot table pulls it in, but it puts it at the bottom of
the pivot table even though I have an "order by" in my
query.

I was hoping there was an event that could be intercepted
after the pivot table has done its refresh to run a sort
macro I created.

Thanks in advance.




All times are GMT +1. The time now is 06:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com