this may be a very easy question,
I have the following macro:
Private Sub Worksheet_Activate()
With ActiveSheet
.PivotTables("PivotTable1").RefreshTable
.PivotTables("PivotTable2").RefreshTable
.PivotTables("PivotTable3").RefreshTable
.PivotTables("PivotTable4").RefreshTable
End With
End Sub
This macro runs automatically when i click on the sheet.
Instead, I want to add a button in this sheet that runs this macro.
How do I do this?
I have the following macro:
Private Sub Worksheet_Activate()
With ActiveSheet
.PivotTables("PivotTable1").RefreshTable
.PivotTables("PivotTable2").RefreshTable
.PivotTables("PivotTable3").RefreshTable
.PivotTables("PivotTable4").RefreshTable
End With
End Sub
This macro runs automatically when i click on the sheet.
Instead, I want to add a button in this sheet that runs this macro.
How do I do this?