#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Automatic pivots


Hey all,

I have a reference page at the end of my workbook which contains
multiple pivot table each of which reflect data from a corresponding
worksheet i.e. the first pivot table reflects data from worksheet 01,
the second gets data from worksheet 02 etc.

I am looking at finding a way to generate these pivot tables
automatically as at the minute whenever I add a new worksheet I then go
to my reference page and copy an existing pivot – paste it and then use
the pivot table wizard to select the correct sheet/ range.

When I recorded the process I got this code:

Sheets(“Reference”).Select
Range("AB1:AC19").Select
Range("AC19").Activate
Selection.Copy
Range("AE1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Range("AE4").Select
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:=
_
"'04'!R8C1:R463C1"
ActiveSheet.PivotTables("PivotTable1").SmallGrid = False
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:= _
"Agent Number/Name"



Can anyone think of a way to automate this? I am thinking it would
involve counting the sheets and updating the formulae

ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
"'04'!R8C1:R463C1"


to look at a variable ‘sheets’ rather then an actual sheet name (in
that case 04).

Hope this all makes sense and thanks for any help.

Hayley


--
Hru48
------------------------------------------------------------------------
Hru48's Profile: http://www.excelforum.com/member.php...o&userid=24895
View this thread: http://www.excelforum.com/showthread...hreadid=558120

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
Automatic and manual calculations bpeltzer Excel Discussion (Misc queries) 0 March 20th 06 02:49 PM
enable automatic refresh Vass Excel Worksheet Functions 2 March 11th 06 04:36 AM
Please help with adding automatic data. tnnt Excel Discussion (Misc queries) 1 March 8th 06 09:42 AM
options to update automatic links Werner Rohrmoser Excel Worksheet Functions 0 November 10th 05 12:58 PM
How can I find automatic links in an Excel-sheet? Tobias Excel Discussion (Misc queries) 4 August 4th 05 09:02 AM


All times are GMT +1. The time now is 04:26 AM.

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

About Us

"It's about Microsoft Excel"