View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Rob[_4_] Rob[_4_] is offline
external usenet poster
 
Posts: 37
Default Delete cell contents

Thankyou so much. Worked perfectly.

As an alternative for another application I have, could you also provide me
with the code to have cells only cleared from a specified range instead of
the whole sheet?

Rob

"Gary''s Student" wrote in message
...
Sub rob()
For Each r In ActiveSheet.UsedRange
If r.Locked Then
Else
r.ClearContents
End If
Next
End Sub
--
Gary''s Student - gsnu200713


"Rob" wrote:

Could someone please provide some VBA code that will delete all cell
contents for all the unlocked cells in a sheet?

Rob