AustinB1980
New Member
- Joined
- Feb 18, 2021
- Messages
- 1
- Office Version
- 2016
- Platform
- Windows
Hi
I need a bit of help stumped getting this to work. I want to refresh specific pivot tables and know the name and the range of each table but I don’t want to use the name in the query I want to use a reference to the name which had been generated by another process. Think example might help clarify what I am trying to do
Sub A()
Set A = Worksheets(“a”).cells(1,14)
Worksheets(“b”).activate
Active sheet.PivotTables(A).PivotCatche.Refresh
End Sub
this returns run time error 1004
the query for A returns “PivotTable1” which is coming from a vlookup elsewhere in the workbook and I can see that name is being used in the formula
If I substitute A for PivotTable1 then it works fine but I need to link the refresh to names of pivot tables generated by another process
Any advice is much appreciated
Thanks
Austin
I need a bit of help stumped getting this to work. I want to refresh specific pivot tables and know the name and the range of each table but I don’t want to use the name in the query I want to use a reference to the name which had been generated by another process. Think example might help clarify what I am trying to do
Sub A()
Set A = Worksheets(“a”).cells(1,14)
Worksheets(“b”).activate
Active sheet.PivotTables(A).PivotCatche.Refresh
End Sub
this returns run time error 1004
the query for A returns “PivotTable1” which is coming from a vlookup elsewhere in the workbook and I can see that name is being used in the formula
If I substitute A for PivotTable1 then it works fine but I need to link the refresh to names of pivot tables generated by another process
Any advice is much appreciated
Thanks
Austin