943,997 Members | Top Members by Rank

Ad:
Mar 17th, 2005
0

Excel pivot table

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manclarky is offline Offline
2 posts
since Mar 2005
Mar 17th, 2005
0

Re: Excel pivot table

Quote originally posted by manclarky ...
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?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004
Mar 17th, 2005
0

Re: Excel pivot table

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
manclarky is offline Offline
2 posts
since Mar 2005
Mar 17th, 2005
0

Re: Excel pivot table

And You Paste that whole thing into VB?
Team Colleague
Reputation Points: 361
Solved Threads: 214
Taboo Programmer
Comatose is offline Offline
2,413 posts
since Dec 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: mscomct2.ocx
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Pop3 Mail Watcher (Part 1)





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC