![]() |
#1
|
|||
|
|||
![]()
The following codes working fine. It creates a sheet (in this case it is sheet7) and then manipulate the data in Mysheet to generate the Pivottable in sheet7.
Code:
Sheets.Add ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Mysheet!R1C1:R46C2", Version:=xlPivotTableVersion14).CreatePivotTable _ TableDestination:="Sheet7!R3C1", TableName:="PivotTable1", DefaultVersion _ :=xlPivotTableVersion14 Code:
Dim Sname As String Sname = ActiveSheet.Name However the following codes did not work and I am sure it is something simple. Any suuport will be appreciated. Thanks Code:
Sheets.Add ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _ "Sheets(Sname)!R1C1:R46C2", Version:=xlPivotTableVersion14).CreatePivotTable _ TableDestination:="Sheet7!R3C1", TableName:="PivotTable1", DefaultVersion _ :=xlPivotTableVersion14 Sheets("Sheet7").Select |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
sheet 2 data highlight in sheet 1 | gsrikanth | Excel | 1 | 04-21-2012 06:25 PM |
![]() |
natsha | Excel | 1 | 02-16-2012 12:41 PM |
Edit Data Source- Linking template charts to new data | lbf | PowerPoint | 0 | 10-28-2011 12:19 PM |
pivot table source data | hannu | Excel | 0 | 07-03-2010 04:54 AM |
Include headers in table of contents | bwhight | Word | 1 | 10-10-2006 08:59 AM |