View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Johnson Ken Johnson is offline
external usenet poster
 
Posts: 1,073
Default MACROS: Protect a cell depending on the value of another cell

frenchflo wrote:
How can create a macro to protect a cell depending on the value of another
cell.
Ex: If A2<0 then I want A3 to be locked for editing.

Thanks for your help.


If Range("A2").Value < 0 Then
ActiveSheet.Unprotect "your password here"
Range("A3").Locked = True
ActiveSheet.Protect "your password here"
End If

Ken Johnson