Pivot Table Code - Simple Code Fix?

  • Thread starter Thread starter J.W. Aldridge
  • Start date Start date
J

J.W. Aldridge

For an expert, this should be a simple fix.....

(at least I assume that it is....)

The following code works, but only for one or two pivot tables on the
worksheet. I have about 12 pivot tables on the same worksheet and I
need them all to refer to A1 for the source data.

What ammendments are needed?




Sub Test()

ActiveSheet.PivotTables(1).SourceData =
Application.ConvertFormula([a1], xlA1, xlR1C1)

End Sub




Thanx
 
Keep in mind that this is just a shot in the dark...

Sub Test()
dim pvt as pivottable

for each pvt in activesheet.pivottalbles
pvt.SourceData = Application.ConvertFormula([a1], xlA1, xlR1C1)
next pvt
End Sub
 
tried it but.....

Error message: object doesnt support this property or method.


Any clues?
 
Back
Top