Pivot Table Macro in Excel 2002

S

Scott

I'm trying to create a macro that will create a Pivot
Table. I'm using the "record" function to record my
steps as I create the Pivot Table.
When I try to run the macro, I get an error: Run-time
error '1004':
AddFields method of PivotTable class failed.

Here's the line in the macro code that fails:
ActiveSheet.PivotTables("PivotTable1").AddFields
RowFields:=Array( _
"Brand Code", "Iams Item Code", "Description"),
ColumnFields:="Date"


Any ideas on what I'm doing wrong?

Thanks,
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top