> Hello, I have a excel tempate for compiling data. How do I add a Control
> button to clear data in unprotected cells only? Can you help? Steve
Hi Tom,
Yes, I already have a macro and button. I added protected cells to range, I
can't seem to edit the macro without errors. Current macros:
Sub clear()
'
' clear Macro
' Macro recorded 1/15/2006 by steve smith
'
'
Range("B2:G10").Select
Range("B2").Activate
Selection.ClearContents
End Sub
I am fairly new to VB. Thank You, Steve
> I assume you are looking of code and not how to add a button to a sheet
>
[quoted text clipped - 6 lines]
> > Hello, I have a excel tempate for compiling data. How do I add a Control
> > button to clear data in unprotected cells only? Can you help? Steve
Tom Ogilvy - 23 Jan 2006 18:11 GMT
Sub clear()
'
' clear Macro
' Macro recorded 1/15/2006 by steve smith
'
'
Dim cell as Range
Range("B2:G10").Select
Range("B2").Activate
for each cell in selection
if cell.locked = false then
cell.ClearContents
end if
Next
End Sub
should work I would think.

Signature
Regards,
Tom Ogilvy
> Hi Tom,
> Yes, I already have a macro and button. I added protected cells to range, I
[quoted text clipped - 23 lines]
> > > Hello, I have a excel tempate for compiling data. How do I add a Control
> > > button to clear data in unprotected cells only? Can you help? Steve