Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

Could someone point me in the right direction or give me a reference on
automating pivot table creation.

I have a pivot table created but the information it is based on changes
on a daily basis. What I had done was set up a macro that pulls the
new list data into my workbook and replaces the data that the pivot
table is based on, then refreshes the table. That way I don't have
to rebuild the table each time I have to update the list. The problem
is that the dropdowns on the pivot table still reflect the old data
values along with the new ones.

Is it possible to get around this and reset the table completely
without having to recreate the table? Or is there a way to automate the
creation of the table?

Thanks
Steve

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default How to refresh the data in a Pivot Table?

There's information here on clearing old items in a pivot table:

http://www.contextures.com/xlPivot04.html

Smonczka wrote:
Could someone point me in the right direction or give me a reference on
automating pivot table creation.

I have a pivot table created but the information it is based on changes
on a daily basis. What I had done was set up a macro that pulls the
new list data into my workbook and replaces the data that the pivot
table is based on, then refreshes the table. That way I don't have
to rebuild the table each time I have to update the list. The problem
is that the dropdowns on the pivot table still reflect the old data
values along with the new ones.

Is it possible to get around this and reset the table completely
without having to recreate the table? Or is there a way to automate the
creation of the table?

Thanks
Steve



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to refresh the data in a Pivot Table?

You would either need to delete the unused values or create a new table. To
create a new table, turn on the macro recorder while you create one
manually. Turn off the macro recorder after completion.

http://www.contextures.com/xlPivot04.html

for code on clearing out the unused data.

Go to http://www.contextures.com/tiptech.html

and look under P for pivot tables for other information on Pivot Tables.
(Debra Dalgleish's site).

--
Regards,
Tom Ogilvy


"Smonczka" wrote in message
oups.com...
Could someone point me in the right direction or give me a reference on
automating pivot table creation.

I have a pivot table created but the information it is based on changes
on a daily basis. What I had done was set up a macro that pulls the
new list data into my workbook and replaces the data that the pivot
table is based on, then refreshes the table. That way I don't have
to rebuild the table each time I have to update the list. The problem
is that the dropdowns on the pivot table still reflect the old data
values along with the new ones.

Is it possible to get around this and reset the table completely
without having to recreate the table? Or is there a way to automate the
creation of the table?

Thanks
Steve



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

Thank you both for your help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

I decided to just rebuild the table on the fly using a macro. I
created a new table but when I run the macro it errors out ...

'make pivot table
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"TableData").CreatePivotTable TableDestination:= _
"[Pivot_Report.xls]TABLE!R3C2",
TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10

This line returns an error.
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array("Week", _
"Assigned to +", "Site Name +", "Cause Code", "Data")

Would you know why this would be? I should just be running the exact
same steps as I did when I made the macro.

Thanks again,
Steve



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default How to refresh the data in a Pivot Table?

The obvious conclusion would be that at least one of those fields does not
exist or that adding it as a rowfield causes a problem. Using the data that
causes the problem as your source, try again recording while you add the
table manually and see if you can discover the problem.

--
Regards,
Tom Ogilvy


"Smonczka" wrote in message
ups.com...
I decided to just rebuild the table on the fly using a macro. I
created a new table but when I run the macro it errors out ...

'make pivot table
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:=
_
"TableData").CreatePivotTable TableDestination:= _
"[Pivot_Report.xls]TABLE!R3C2",
TableName:="PivotTable1", DefaultVersion:= _
xlPivotTableVersion10

This line returns an error.
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array("Week", _
"Assigned to +", "Site Name +", "Cause Code", "Data")

Would you know why this would be? I should just be running the exact
same steps as I did when I made the macro.

Thanks again,
Steve



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

Tom actualy the problem was very strange. I had to insert a string
that activated a cell in the pivot table then continue with the macro.
It looked as if the macro would make a blank table then could not
figure out where the table was located. Once I inserted code to point
any cell in the table after the table was created but before it was
populated it worked perfectly.

I have no Idea why this was happening though.

Steve

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

Tom actualy the problem was very strange. I had to insert a string
that activated a cell in the pivot table then continue with the macro.
It looked as if the macro would make a blank table then could not
figure out where the table was located. Once I inserted code to point
any cell in the table after the table was created but before it was
populated it worked perfectly.

I have no Idea why this was happening though.

Steve

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default How to refresh the data in a Pivot Table?

Tom actualy the problem was very strange. I had to insert a string
that activated a cell in the pivot table then continue with the macro.
It looked as if the macro would make a blank table then could not
figure out where the table was located. Once I inserted code to point
any cell in the table after the table was created but before it was
populated it worked perfectly.

I have no Idea why this was happening though.

Steve

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
Create refresh button in worksheet to refresh Pivot Table Data Ron Excel Worksheet Functions 1 October 13th 07 01:20 AM
Refresh Data Pivot Table Annabel Excel Discussion (Misc queries) 0 October 3rd 06 09:00 AM
Pivot table Data refresh SSD1 Excel Worksheet Functions 2 June 17th 05 09:13 PM
Pivot Table Data Refresh patemarie Excel Discussion (Misc queries) 1 December 1st 04 04:35 PM
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH Ken Roberts Excel Programming 3 September 11th 03 06:02 AM


All times are GMT +1. The time now is 04:08 PM.

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"