View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dungan dan dungan is offline
external usenet poster
 
Posts: 411
Default how to clear all unlocked cells except D4

Thanks Dave,

That works great!

I used the original procedure in the cmdReset button, and your edit
for the cmdAddPart button. I'm wondering if there is a way to write
that procedure so either button could use it to perform it's different
function.

Dan

On Oct 19, 12:06 pm, Dave Peterson wrote:
For Each myCell In Range("A1:N100")
if mycell.address = "$D$4" then
'skip it
elseIf myCell.Locked = False Then
If myCell.MergeCells Then
If myCell.Address = myCell.MergeArea(1).Address Then
myCell.MergeArea.ClearContents
End If
Else
myCell.ClearContents
End If
End If
Next myCell