I have used the Pivot Form wizard to create a pivot table. This is the code behind the Edit Pivot table button.

Private Sub btnEdit_Click()
On Error GoTo btnEdit_Err
Me!PivotTable.Verb = acOLEVerbOpen
Me!PivotTable.Action = acOLEActivate
Exit Sub
MsgBox Error$
Resume btnEdit_Exit
End Sub

Can someone add the commands that will do the follwing automatically:

3 On the Data menu in Microsoft Excel, click Refresh Data. (copied direct from help)

I want to make it part of a function where the desired FROM TO dates are entered and the pivot table form automatically updates on opening.