Hi
I've created a Command Button from the Control Toolbox menu and added the following code using the view code option.
When I click the button I receive the following message:
"Run time error 1004 application defined or object defined error"
When I click debug the 2nd line of code is highlighted yellow.
Is there something wrong with the piece of code??
Thanks
J
Private Sub CommandButton1_Click()
Sheets("Summary").Range("A6").QueryTable.Refresh BackgroundQuery:=True
End Sub
The pivot table is on sheet Summary and the pivot starts from cell A4
I've created a Command Button from the Control Toolbox menu and added the following code using the view code option.
When I click the button I receive the following message:
"Run time error 1004 application defined or object defined error"
When I click debug the 2nd line of code is highlighted yellow.
Is there something wrong with the piece of code??
Thanks
J
Private Sub CommandButton1_Click()
Sheets("Summary").Range("A6").QueryTable.Refresh BackgroundQuery:=True
End Sub
The pivot table is on sheet Summary and the pivot starts from cell A4