Hi all,
I was very kindly helped out (by Tom Ogilvy) to create an event procedure
code that locks a cell on a worksheet as soon as something is entered into
that cell. The code itself is as follows:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo ErrHandler:
If Target.Address = "$B$8" Then
Application.EnableEvents = False
Me.Unprotect
If Target.Value = "Null" Then
Range("B8").Locked = False
Else
Range("B8").Locked = True
End If
Me.Protect
Application.EnableEvents = True
End If
ErrHandler:
Application.EnableEvents = True
If Err.Number <> 0 Then
End If
End Sub
However, I am now trying to to get the code to look at more than just one
cell, and have been struggling with this for the last day! Does anyone know
if it will be possible to do this using the code above, and if so, how would
I go about it? I have tried repeating the if loops etc. but with no luck!
Thanks in advance for any help!!
TBD
Bookmarks