Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to update pivot table data range

Does anyone have a quick macro that goes an updates the data range for
a pivot table? At present, additional data rows are being added to the
data set which are below and outside of the data range previously
defined. The data is on a different worksheet to the pivot table. I
would like to simply assign this macro to a button next to the pivot
table so that the user spends no time manually updating the data range
to include the additional rows added each month.

Thanks

Mike

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro to update pivot table data range

the easiest way is to use a dynamic range to define the database

Insert=Name=Define

Name: MyData
Refersto: =Offset(Sheet3!$A$1,0,0,CountA(Sheet3!$A:$A),10)


then make that the source for you pivot table. Now, whenever the user
refreshes the data, it will use the expanded range.

If you want to have your button refresh the data, the code would be

Private Sub CommandButton1_Click()
worksheets("Sheet1").PivotTables("Table1").Refresh Table
End Sub

--
Regards,
Tom Ogilvy


"Mike_M" wrote in message
oups.com...
Does anyone have a quick macro that goes an updates the data range for
a pivot table? At present, additional data rows are being added to the
data set which are below and outside of the data range previously
defined. The data is on a different worksheet to the pivot table. I
would like to simply assign this macro to a button next to the pivot
table so that the user spends no time manually updating the data range
to include the additional rows added each month.

Thanks

Mike



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro to update pivot table data range

Thanks - much appreciated

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
update pivot table data range JN[_2_] Charts and Charting in Excel 2 September 29th 08 08:40 PM
record a macro to update pivot table louiscourtney Excel Discussion (Misc queries) 1 July 21st 07 04:50 AM
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
Update Data Field in Pivot Table with Dynamic Excel Range ExcelMonkey[_97_] Excel Programming 1 March 3rd 04 08:16 PM
Macro to update Pivot Table Paul Excel Programming 2 September 15th 03 09:00 AM


All times are GMT +1. The time now is 09:24 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"