Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel 2000 - 2003 Compatability problem with pivottables
Hi,
I came up with some code that creates a pivottable just the way I want it in Excel 2003. However, the code throws an error in Excel 2000 at the 'AddDataField' part. I've tried and tried to recreate the same effect in 2000 - anyone got any idea what the equivalent work around code would be? Thanks for any help Sub CreatePT() Set wksD.Range("rDataRangeCorner").CurrentRegion.Name = "rSourceData" ThisWorkbook.PivotCaches.Add(SourceType:=xlDatabas e, SourceData:="=rSourceData") _ .CreatePivotTable TableDestination:="=rDestination", _ TableName:="PivotTable1" Set ptPivot = wksP.PivotTables("PivotTable1") With ptPivot .ColumnGrand = False .PivotFields("Date").Orientation = xlRowField .PivotFields("Description").Orientation = xlRowField .PivotFields("P").Orientation = xlPageField .PivotFields("Month").Orientation = xlPageField .AddDataField ptPivot.PivotFields("Hours"), "Sum of Hours", xlSum .PivotFields("Value").Orientation = xlColumnField .AddDataField ptPivot.PivotFields("Value"), "Sum of Value", xlSum .DataPivotField.Orientation = xlColumnField 'Weird code to get rid of row subtotals .PivotFields("Date").Subtotals = Array(False, False, _ False, False, False, False, False, False, False, False, False, False) End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I sort data in PivotTables in Excel 2000? | Excel Discussion (Misc queries) | |||
Problem with Excel 2000 / 2003 | Excel Discussion (Misc queries) | |||
2000/03 Compatability Problem | Excel Programming | |||
Office 2003 Compatability Problem (I think) | Excel Programming | |||
Compatability Problem with Office 2003 | Excel Programming |