ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Update Range of a Pivot Table (https://www.excelbanter.com/excel-programming/359210-auto-update-range-pivot-table.html)

TJDeborah[_2_]

Auto Update Range of a Pivot Table
 

I have created a simple data base and pivot table / report. I would
like the pivot table to automatically update to a new range (if data
has been added to the next available row of course) in addition to
updating existing data. Can anyone help with this. I have used this
to auto update the existing data when the sheet is activated.

Option Explicit

Private Sub Worksheet_Activate()

ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh

End Sub

Works great. Thanks

Terri


--
TJDeborah
------------------------------------------------------------------------
TJDeborah's Profile: http://www.excelforum.com/member.php...o&userid=33186
View this thread: http://www.excelforum.com/showthread...hreadid=533987


Dave Peterson

Auto Update Range of a Pivot Table
 
Take a look at defining a range name that grows and contracts based on your
data.

See Debra Dalgeish's site for some nice tips:
http://contextures.com/xlNames01.html#Dynamic

TJDeborah wrote:

I have created a simple data base and pivot table / report. I would
like the pivot table to automatically update to a new range (if data
has been added to the next available row of course) in addition to
updating existing data. Can anyone help with this. I have used this
to auto update the existing data when the sheet is activated.

Option Explicit

Private Sub Worksheet_Activate()

ActiveSheet.PivotTables("PivotTable1").PivotCache. Refresh

End Sub

Works great. Thanks

Terri

--
TJDeborah
------------------------------------------------------------------------
TJDeborah's Profile: http://www.excelforum.com/member.php...o&userid=33186
View this thread: http://www.excelforum.com/showthread...hreadid=533987


--

Dave Peterson


All times are GMT +1. The time now is 09:14 AM.

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