If you protect the sheet with VBA, then use the UserInterfaceOnly setting, so macros can change the sheet without unprotecting.
Sheets(1).Protect Password:="Secret", UserInterFaceOnly:=True
Or, if you don't use code to protect the sheet, just unprotect it before the changes and then protect it again.
Sub Clear()
Dim vbResponse As VbMsgBoxResult
vbResponse = MsgBox("Are you sure you want to clear data?", vbOKCancel, "Clear?")
If vbResponse = vbOK Then
Sheet1.Unprotect Password:="Secret"
Range("C7:E200").ClearContents
Sheet1.Protect Password:="Secret"
Else
Exit Sub
End If
End Sub
Change the references to reflect your setup.
Bookmarks