I created a maco (Clearcells), but I cannot seem to make it work.
It should clear the contents from cells W3:W5 in a different worksheet (Calls Data) and then assign W3 with the value of 1. I am missing something here. Also, how can I add the code to include to refresh a pivot table after the first 2 steps?
It should clear the contents from cells W3:W5 in a different worksheet (Calls Data) and then assign W3 with the value of 1. I am missing something here. Also, how can I add the code to include to refresh a pivot table after the first 2 steps?
Code:
Sub Clearcells()
With Sheets("Calls Data")
.Range(.Cells(3, 23), .Cells(5, 23)).ClearContents
.Range.Cells(3, 23).Select
End With
Selection.Value = 1
End Sub