Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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
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
How do I sort data in PivotTables in Excel 2000? Maria Excel Discussion (Misc queries) 1 June 25th 09 03:12 PM
Problem with Excel 2000 / 2003 TonTon165 Excel Discussion (Misc queries) 0 July 17th 06 08:14 PM
2000/03 Compatability Problem Hambone[_6_] Excel Programming 0 November 29th 05 07:14 PM
Office 2003 Compatability Problem (I think) KimR.Hammel[_2_] Excel Programming 0 November 29th 05 02:36 AM
Compatability Problem with Office 2003 Hambone[_6_] Excel Programming 0 November 29th 05 01:20 AM


All times are GMT +1. The time now is 09:25 PM.

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

About Us

"It's about Microsoft Excel"