I want to update the Data Source of a pivot table but when I run the makro I get following error:
The PivotTable field is not a valid. To create a Pivottable report, you must use data that is organized as a list with labeled columns...
DataArea = "Log Defects!$A$3:$L$10000"
ActiveSheet.PivotTables("PivotTablePriority").SourceData = DataArea
The Pivot Table name is correct! The Data Area is copyied from excel (when I click on the pivot table and can select the data source) so the selection should be correct.
Log Defects
... When I make a pivot table on my local computer, if the data is on a sheet that has spaces in the name I need single quotes, meaning that line should sayDataArea = "'Log Defects'!$A$3:$L$10000"
– Dan Wagner