Excel pivot table

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2005
Posts: 2
Reputation: manclarky is an unknown quantity at this point 
Solved Threads: 0
manclarky manclarky is offline Offline
Newbie Poster

Excel pivot table

 
0
  #1
Mar 17th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Excel pivot table

 
0
  #2
Mar 17th, 2005
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?
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 2
Reputation: manclarky is an unknown quantity at this point 
Solved Threads: 0
manclarky manclarky is offline Offline
Newbie Poster

Re: Excel pivot table

 
0
  #3
Mar 17th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Excel pivot table

 
0
  #4
Mar 17th, 2005
And You Paste that whole thing into VB?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC