A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Click anywhere in the pivottable.
Activate the Developer tab of the ribbon.
In the Controls group, click Insert > Button under Form Controls.
Click on the worksheet or drag a rectangle on the worksheet.
The Assign Macro dialog appears.
Click New
The Record Macro dialog appears.
You can assign a keyboard shortcut here if you wish.
Click OK.
The Visual Basic Editor appears, with code similar to
Sub Button1_Click()
End Sub
Edit it to make it look like this:
Sub Button1_Click()
ActiveSheet.PivotTables(1).PivotCache.Refresh
End Sub
Switch back to Excel.
Save the workbook in a macro-enabled format such as .xlsm, .xlsb or .xls.