How do I add to this code to say if row F says B then lock rows G and H?
I managed to do it earlier but caused another problem so had to start again. I seem to get close but can't get it correct!
Private Sub Worksheet_Change(ByVal Target As Range)
'Cell with A/B in it
If Not Intersect(Target, Columns("F:F")) Is Nothing Then
'Unprotect sheet
ActiveSheet.Unprotect "peoplepoint"
'If A
If UCase(Target) = "A" Then
'Lock cell
With Range("K" & Target.Row & ":P" & Target.Row)
.Locked = True
.Interior.Color = RGB(192, 192, 192)
End With
Else
'Unlock cell
With Range("K" & Target.Row & ":P" & Target.Row)
.Locked = False
.Interior.Color = RGB(255, 255, 255)
End With
End If
'Re protect sheet
ActiveSheet.Protect "peoplepoint"
End If
End Sub
Bookmarks