Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Pivot Table Question

Untested...

...., tabledestination:=worksheets("Forecast").range("A1 "), ...

Aaron wrote:

Hello,

I have the following code that I need to change. I need the source data to
check for the end of page and the Table Destination to be on a different tab
(TabName: forecast)

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'Forecasting Tool'!R2C1:R4784C44").CreatePivotTable
TableDestination:=Range( _
"A1"), TableName:="PivotTable1"
ActiveSheet.PivotTables("PivotTable1").SmallGrid = False
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Unique Ref1"
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Wk1 Forecast by
Kit")
.Orientation = xlDataField
.Caption = "Max of Wk1 Forecast by Kit"
.Function = xlMax
End With
End Sub

Thanks!


--

Dave Peterson
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Pivot Table Question

Use a dynamic name that grows/contracts with the data.

Check how Debra Dalgleish does it:
http://contextures.com/xlNames01.html#Dynamic

Aaron wrote:

Hi Dave,
This piece worked but also needed to know how to extend the source data as
new records are added.

Thanks,
Aaron

"Dave Peterson" wrote:

Untested...

...., tabledestination:=worksheets("Forecast").range("A1 "), ...

Aaron wrote:

Hello,

I have the following code that I need to change. I need the source data to
check for the end of page and the Table Destination to be on a different tab
(TabName: forecast)

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _
"'Forecasting Tool'!R2C1:R4784C44").CreatePivotTable
TableDestination:=Range( _
"A1"), TableName:="PivotTable1"
ActiveSheet.PivotTables("PivotTable1").SmallGrid = False
ActiveSheet.PivotTables("PivotTable1").AddFields RowFields:="Unique Ref1"
With ActiveSheet.PivotTables("PivotTable1").PivotFields ("Wk1 Forecast by
Kit")
.Orientation = xlDataField
.Caption = "Max of Wk1 Forecast by Kit"
.Function = xlMax
End With
End Sub

Thanks!


--

Dave Peterson


--

Dave Peterson
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 Question John Calder New Users to Excel 3 May 9th 09 12:49 AM
Pivot Table Question Connie Martin Excel Discussion (Misc queries) 0 May 7th 08 02:20 PM
Pivot Table Question: SubTotals for 2 of 4 Pivot Tables in same worksheet [email protected] Excel Programming 0 December 19th 06 05:13 PM
Pivot Table Question Spreadsheet Excel Discussion (Misc queries) 0 May 24th 06 03:17 AM
Pivot Table Question : If statment in Pivot Table?? seve Excel Discussion (Misc queries) 2 November 22nd 05 01:00 AM


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