Trouble recreating Pivot table changes in VBA

A

andycharger

Im having some problems with my pivot table changes in VBA

I am calling my pivot table up like below but when I add the sourcetyp
and sourcedata, it gives me the following error:

Run Time Error '1004';
The Pivot table field name is not valid. To create a pivot tabl
report, you must use data that is organised as a list with labelle
columns. If you are changing the name of a pivot table field , you mus
type a new name for the field

Here is my code:
[vb]
Sheets("source Code").Activate
ActiveSheet.PivotTableWizard SourceType:=xlDataBase
SourceData:="'!Quotes 2004' !$a$1:$k$6336"
ActiveWorkBook.ShowPivotTableFieldList = True
[/vb]

Anyone shed any light on this
 
B

BrianB

It is much easier to record a macro when making up a pivot table an
amend that as necessary
 
Top