View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
johnsail johnsail is offline
external usenet poster
 
Posts: 38
Default conditional unlock

Hi Mike,
First thanks for quick response.

Am new to macros / VB so don't really understand how to use your info. Also
don't know if my question was clear so . . . .

3 cells in worksheet. A1 B1 C1.
A1 unlocked. B1 and C1 both locked.

Enter cat in A1 and need to unlock B1 so data can be entered.
Enter dog in A1 and need to unlock C1 so data can be entered.

John



"Mike H" wrote:

Hi,

Right click the sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Range("A1").Value = "lock" Then
ActiveSheet.Unprotect
Range("B1").Locked = True
ActiveSheet.Protect

Else
ActiveSheet.Unprotect
Range("B1").Locked = False
ActiveSheet.Protect
End If
End Sub

Mike

"johnsail" wrote:

Is there a way to unlock a cell dependant on values entered in another
(unlocked) cell?

Excell 2003