LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default urgent-pivot table

Hi..

I am completely zapped at whats happening...i was running
running the macro very nicely and all of a sudden the its
giving error and i am unable to resolve it. I was creating
a pivot table in a new sheet. and now the new sheet is not
getting created somehow (#$%^&) and its processing on the
same sheet from whihc it has to take pivot values and
gives a error "do u want to replace of destination cells
in RawData?"

here is the piece of code where i create a pivot table in
a new sheet. the new sheet gets created but somehow the
pivot is not being created ...!
Set NewSheet = Worksheets.Add
(Befo=ActiveWorkbook.Worksheets.Item(1))
NewSheet.Name = "test"
ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatab ase,
SourceData:= _
rawDataWorksheetName & "!R1C1:R" & LastCellNum
& "C" & CU).CreatePivotTable TableDestination:="",
TableName:= _
"PivotTable5",
DefaultVersion:=xlPivotTableVersion10
ActiveSheet.PivotTableWizard
TableDestination:=ActiveSheet.Cells(3, 1)
ActiveSheet.Cells(3, 1).Select
ActiveWorkbook.ShowPivotTableFieldList = True

With ActiveSheet.PivotTables("PivotTable5").PivotFields
("Test_Loc")
.Orientation = xlRowField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable5").PivotFields
("Package")
.Orientation = xlRowField
.Position = 2
End With
With ActiveSheet.PivotTables("PivotTable5").PivotFields
("PL")
.Orientation = xlRowField
.Position = 3
End With
ActiveSheet.PivotTables("PivotTable5").AddDataFiel d
ActiveSheet.PivotTables( _
"PivotTable5").PivotFields(trapCumVal), "Sum of "
& trapCumVal, xlSum
ActiveWorkbook.ShowPivotTableFieldList = False
Range("B6").Select
ActiveSheet.PivotTables("PivotTable5").PivotFields
("Package").Subtotals = Array _
(False, False, False, False, False, False, False,
False, False, False, False, False)

Range("A81").Select
ActiveSheet.PivotTables("PivotTable5").PivotFields
("Test_Loc").Subtotals = _
Array(False, False, False, False, False, False,
False, False, False, False, False, False)

ActiveSheet.Select
sheetname = "MSP"
please do suggest
thanks

 
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
Urgent! PIVOT TABLE FIGURES REQUIRED IN MILLIONS FARAZ QURESHI Excel Discussion (Misc queries) 1 April 17th 08 07:58 AM
Multiple Range Pivot Table (Urgent Please) FARAZ QURESHI Excel Discussion (Misc queries) 0 September 15th 07 06:28 AM
URGENT! Retain format of cells in pivot table upon refresh KDG Excel Discussion (Misc queries) 3 September 10th 07 10:02 AM
URGENT PLEASE! Filtering a Pivot Table further hile trotman Excel Worksheet Functions 4 February 1st 07 04:32 PM
pivot table error.Please help! very urgent anu_manu Excel Discussion (Misc queries) 0 February 13th 06 08:34 PM


All times are GMT +1. The time now is 02:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"