0

I created a macro designing a pivot table.
when i copy the code into the VB application the pivot table shows a count instead of a sum!!!

Any ideas why?

Cheers

2
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by Comatose
0

I created a macro designing a pivot table.
when i copy the code into the VB application the pivot table shows a count instead of a sum!!!

Any ideas why?

Cheers

Hmn, Post the relevant code?

0

Good idea - Sorry!!!


xlApp.ActiveWorkbook.PivotCaches.Add(SourceType:=xlDatabase, SourceData:="Sheet1!R1C1:R14C3").CreatePivotTable TableDestination:=xlApp.Range("E10"), TableName:="PivotTable2"
xlApp.ActiveSheet.PivotTables("PivotTable2").SmallGrid = False
With xlApp.ActiveSheet.PivotTables("PivotTable2").PivotFields("Event Date")
.Orientation = xlRowField
.Position = 1
End With
With xlApp.ActiveSheet.PivotTables("PivotTable2").PivotFields("Product")
.Orientation = xlColumnField
.Position = 1
End With
With xlApp.ActiveSheet.PivotTables("PivotTable2").PivotFields("Cost")
.Orientation = xlDataField
.Position = 1
End With
xlSheet.Application.CommandBars("PivotTable").Visible = False
xlSheet.Range("G16").Select

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.