Thread: vba code
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default vba code

Hi,

Here's one way

Sub ClearCells()
ActiveSheet.Protect
On Error Resume Next
ActiveSheet.UsedRange = ""
On Error GoTo 0
ActiveSheet.Unprotect
End Sub


Mike

"CandiC" wrote:

does anyone know if it is possible to write a macro to clear all unlocked
cells by the click of a button on a user form?