Thread: pivot table
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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