Treeza
09-23-2008, 08:30 AM
Hi,
I'm trying to create a macro button to refresh 'any' pivot table - preferablly keeping the macro in my personal workbook.
However, when I Have created it:
Sub Refresh_pivot()
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
It does not work if there are more than one pivot tables to a workbook. I'm certain it has something to do with the infomation in the () but I dont know how to change this to include 'any' pivot. It's probably REALLY simple - but I'm relatively new to macro creating.
Please help if you can.
Thanks in advance
Teresa
I'm trying to create a macro button to refresh 'any' pivot table - preferablly keeping the macro in my personal workbook.
However, when I Have created it:
Sub Refresh_pivot()
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
End Sub
It does not work if there are more than one pivot tables to a workbook. I'm certain it has something to do with the infomation in the () but I dont know how to change this to include 'any' pivot. It's probably REALLY simple - but I'm relatively new to macro creating.
Please help if you can.
Thanks in advance
Teresa