View Single Post
  #3   Report Post  
Paul B
 
Posts: n/a
Default

Newbie, here is one way, right click on the worksheet tab and view code,
paste this in the window that opens. Unlock all cells in the range first,
change the range to your range and the password to a password you want. Will
protect the cell after someone puts data in it



Private Sub Worksheet_Change(ByVal Target As Range)

Dim MyRange As Range



'change range here

Set MyRange = Intersect(Range("A1:B10"), Target)

If Not MyRange Is Nothing Then



'change password here

Unprotect password:="123"

MyRange.Locked = True

'change password here

Protect password:="123"

End If

End Sub
--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003


"newbie" wrote in message
...
Is it possible to protect a cell if the value is not equal to zero or
blank?

I am using Excel 2002 and want to allow people to be able to enter values
into the worksheet, but once they have been entered, I do not want them to
be
changed.

Thanks,