Hi all,
I'm having an issue correctly modifying the source data for a given pivot table.
I currently have the following code:
The issue I believe I am having is passing the string to "SourceData". I have attempted removing the [" & LastRow & "] portion of the code, and replacing it with a static number, but I still end up with a runtime 80070057 error (PivotTable field name is not valid. I have double checked, and none of the field names have changed, and I have used the same dummy address for the code that I have manually set before.
Can anyone help me out? Thanks!
I'm having an issue correctly modifying the source data for a given pivot table.
I currently have the following code:
Code:
ActiveSheet.PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"ETD WIP DATA!R10C1:R" & LastRow & "C23" _
, Version:=xlPivotTableVersion12)
The issue I believe I am having is passing the string to "SourceData". I have attempted removing the [" & LastRow & "] portion of the code, and replacing it with a static number, but I still end up with a runtime 80070057 error (PivotTable field name is not valid. I have double checked, and none of the field names have changed, and I have used the same dummy address for the code that I have manually set before.
Can anyone help me out? Thanks!