Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 66
Default update a Pivot Table with new data added to the base data

I have a macro that collects lots of data from four sheets and re-arranges it
so it is suitable for a pivot table. I have the pivot table, but I want to
make sure if my data grows that the new rows are picked up by the pivot
table. How can I set the data range used by the pivot table from my macro?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default update a Pivot Table with new data added to the base data

After the macro updates the data, have it create a name:

rngData.Name = "'" & wsData & "'!PivotData"

where rngData is the entire data range including the header row and wsData
is the worksheet containing this data. Select the Pivot Table, then open the
Pivot Table wizard, go Back, and for source data, enter the
worksheet-qualified name in the box for the source data.

Now when the macro updates the data range, it updates the name. Then when
the pivot table is refreshed, it uses the new larger data range.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Graham Y" wrote in message
...
I have a macro that collects lots of data from four sheets and re-arranges
it
so it is suitable for a pivot table. I have the pivot table, but I want to
make sure if my data grows that the new rows are picked up by the pivot
table. How can I set the data range used by the pivot table from my macro?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Data did not update Dave Excel Worksheet Functions 1 March 12th 07 10:24 PM
What happens if the data base changes; will the Pivot Table autom [email protected] Excel Discussion (Misc queries) 1 November 19th 06 06:16 PM
How do I set the pivot table to auto-update the data range? Toni @ Fidelity Excel Discussion (Misc queries) 3 March 17th 06 09:45 PM
pivot table with selection values not included in the base data confused Charts and Charting in Excel 0 June 21st 05 02:42 PM
pivot table with dynamic base data bb Charts and Charting in Excel 2 June 13th 05 04:16 PM


All times are GMT +1. The time now is 06:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"