Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot table
hi...
i am creating a pivot table as many times there are sheets in the workbook. each pivot needs to be created in a new sheet. i am able to a new sheet. but my pivot is not geting created ..nor it gives any error. here is a part of a code: For i = 1 To totSheets Set NewSheet = Worksheets.Add (befo=ActiveWorkbook.Worksheets.Item(1)) NewSheet.Name = "Summary " & arrWkShNames(f) tmpStr = "Summary " & arrWkShNames(f) Sheets("Summary " & arrWkShNames(f)).Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ arrWkShNames(f) & "!R" & rng1.Row & "C1:R" & arrLRow(i) & "C" & rngUnderCost (i).Column).CreatePivotTable TableDestination:="[" & fileSaveName & "]" & tmpStr & "!R3C1", TableName _ :="PivotTable2", DefaultVersion:=xlPivotTableVersion10 thanks a lot |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot table
It seems odd that you are using "f" as the index into your sheet names and
using "i" as the index into an array of row numbers and an offset to a range reference to get a column number. I suspect that "f" and "i" may not be coordinated and may be the source of your problem. Also, does rngUnderCost ever change? Even if it does, rngUnderCost(i).Column should always return the same column number regardless of i. This doesn't seem inconsistent, but it seems odd to use a variable for the index if the results are constant. -- Regards, Tom Ogilvy wrote in message ... hi... i am creating a pivot table as many times there are sheets in the workbook. each pivot needs to be created in a new sheet. i am able to a new sheet. but my pivot is not geting created ..nor it gives any error. here is a part of a code: For i = 1 To totSheets Set NewSheet = Worksheets.Add (befo=ActiveWorkbook.Worksheets.Item(1)) NewSheet.Name = "Summary " & arrWkShNames(f) tmpStr = "Summary " & arrWkShNames(f) Sheets("Summary " & arrWkShNames(f)).Select ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase, SourceData:= _ arrWkShNames(f) & "!R" & rng1.Row & "C1:R" & arrLRow(i) & "C" & rngUnderCost (i).Column).CreatePivotTable TableDestination:="[" & fileSaveName & "]" & tmpStr & "!R3C1", TableName _ :="PivotTable2", DefaultVersion:=xlPivotTableVersion10 thanks a lot |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot table
yah all these values are well taken care of ... the (f)'s
and i's are not the problem. the problem comes he TableDestination:="[" & fileSaveName & "]" & tmpStr & "! R3C1" if i give Tabledestination:="" then all my pivot are created. thanks for any feedback -----Original Message----- It seems odd that you are using "f" as the index into your sheet names and using "i" as the index into an array of row numbers and an offset to a range reference to get a column number. I suspect that "f" and "i" may not be coordinated and may be the source of your problem. Also, does rngUnderCost ever change? Even if it does, rngUnderCost(i).Column should always return the same column number regardless of i. This doesn't seem inconsistent, but it seems odd to use a variable for the index if the results are constant. -- Regards, Tom Ogilvy wrote in message ... hi... i am creating a pivot table as many times there are sheets in the workbook. each pivot needs to be created in a new sheet. i am able to a new sheet. but my pivot is not geting created ..nor it gives any error. here is a part of a code: For i = 1 To totSheets Set NewSheet = Worksheets.Add (befo=ActiveWorkbook.Worksheets.Item(1)) NewSheet.Name = "Summary " & arrWkShNames(f) tmpStr = "Summary " & arrWkShNames(f) Sheets("Summary " & arrWkShNames(f)).Select ActiveWorkbook.PivotCaches.Add (SourceType:=xlDatabase, SourceData:= _ arrWkShNames(f) & "!R" & rng1.Row & "C1:R" & arrLRow(i) & "C" & rngUnderCost (i).Column).CreatePivotTable TableDestination:="[" & fileSaveName & "]" & tmpStr & "!R3C1", TableName _ :="PivotTable2", DefaultVersion:=xlPivotTableVersion10 thanks a lot . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to create pivot table from existing pivot table in excel 2007 | Excel Discussion (Misc queries) | |||
Print Pivot Table headers on pages with Pivot Table | Excel Worksheet Functions | |||
Filter lines with Pivot table and non pivot table columns | Charts and Charting in Excel | |||
Filter lines containing pivot table and non pivot table data | Excel Worksheet Functions | |||
Help required with setting up a pivot table with the source on sheet1 to have the pivot table created on sheet called "report" | Excel Programming |