Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default pivot table destination

Hi,
Is it possible to create a pivot table on a new sheet but to choose its position ? Like you can choose when it is on the same worksheet.
Is it with .CreatePivotTable TableDestination:="" ?

Cheers,
Douvid

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default pivot table destination

The following code creates a new sheet, and creates the PT at cell A3:

'=============================
Sub PivotTableNewSheet()
Dim ws1 As Worksheet
Dim wsNew As Worksheet
Set ws1 = ActiveSheet
Set wsNew = Worksheets.Add

ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, _
SourceData:="Database").CreatePivotTable _
TableDestination:=wsNew.Range("A3"), _
TableName:="PivotTable1"
wsNew.PivotTables("PivotTable1").AddFields _
RowFields:="Year", ColumnFields:="Region"
wsNew.PivotTables("PivotTable1").PivotFields("Unit s") _
.Orientation = xlDataField
ws1.Select
End Sub
'=============================

Douvid wrote:
Hi,
Is it possible to create a pivot table on a new sheet but to choose its position ? Like you can choose when it is on the same worksheet.
Is it with .CreatePivotTable TableDestination:="" ?

Cheers,
Douvid



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

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
how to create pivot table from existing pivot table in excel 2007 Udayraj Dhulekar Excel Discussion (Misc queries) 2 July 8th 13 08:22 PM
Print Pivot Table headers on pages with Pivot Table tsgoose Excel Worksheet Functions 0 December 9th 08 08:14 PM
Filter lines with Pivot table and non pivot table columns Grover Charts and Charting in Excel 4 September 28th 07 03:16 AM
Filter lines containing pivot table and non pivot table data Grover Excel Worksheet Functions 0 September 24th 07 07:20 PM
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" Diana[_5_] Excel Programming 0 August 21st 03 10:19 PM


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