Thanks, you're right. The locked/unlocked issue was irrelavant.
The revised code provided works great! What would be your
suggestion if upon clearing the cells I do and resetting the focus
with the following used (below), lets say that I want to do all that
the code indicates for clearing but also resets cells G5:G12 with
the following formula on click:
=IF(ISBLANK(E9),0,IF(E9="NM",0,IF(E9="CR",0,G$3)))
Original Code:
Private Sub ClearButton1_Click()
Dim ocell As Range
Range("G3").ClearContents
For Each ocell In Range("E5:E12")
ocell.ClearContents
Range("G3").Select
Range("G3").Activate
Next ocell
End Sub