View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tuckland Tuckland is offline
external usenet poster
 
Posts: 5
Default Macro: Clear contents of unlocked cells

Hi everybody
I´ve just pasted the following macro and run it within my worksheet, but an
error displays as I have merged cells.

Should I consider some additional sentence for that?? (I don't know how
works VBA).

Sub rob()
For each r in activesheet.range("C7:h29").cells
if r.locked then
else
r.clearcontents
end if
Next
End sub

Thank you in advance