Archive of Mr Excel Message Board
Back to Excel VBA archive index
Back to archive home
automate pivot table with macroPosted by Tonya on January 30, 2002 11:03 AM
Is it possible to incorporate the creation of a pivot table
with a macro.
|Check out our Excel VBA Resources
Re: automate pivot table with macroPosted by Juan Pablo G. on January 30, 2002 11:20 AM
Re: automate pivot table with macroPosted by Tonya on January 30, 2002 11:50 AM
How? I was able to create the macro, but when I attempted to run the macro it
gave an error and wanted to debug. I'll give it another try.
Re: automate pivot table with macroPosted by Juan Pablo G. on January 30, 2002 12:56 PM
Dim PT As PivotTable
Set PT = ActiveSheet.PivotTableWizard(SourceType:=xlDatabase, SourceData:=Range("A1:D200"))
.PivotFields("Year").Orientation = xlRowField
.PivotFields("Sales").Orientation = xlColumnField
Look at the Online Help. It does help, altough it can be a little confusing creating a Pivot Table through macro.
Juan Pablo G.
This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store
to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.