I am creating a Pivot Table on the fly that will be used in a further step. The problem is that the SourceData table changes name each time.
Can I specify a generic name or a compiled one? Code sample?
Alan
Code:
ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, _
SourceData:=[b]"Table5"[/b], _
Version:=xlPivotTableVersion14).CreatePivotTable TableDestination _
:=TheName & "!R1C1", TableName:="Pivot" & ShtNm, DefaultVersion:= _
xlPivotTableVersion14
Alan