I would like create some button which will be refresh my pivot table after data changes. But my code remove all date and left empty template. This is my code. How i can resolve this
Sub RefreshAllPivots()
Dim pc as PivotCache
For each pc in thisWorkbook.PivotCaches
Pc.resfresh
Next pc
End sub