Hi John
The groups are not behaving normally today :-(
This is based on the code Mike posted earlier.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
If Not IsNumeric(Target) Then Exit Sub 'Allow Numeric values only
If Target.Value <> "" Then
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="MyPass"
Target.Offset(0, 2).Resize(1, 3).Locked = False
ActiveSheet.Protect Password:="MyPass"
Application.EnableEvents = True
Else
'Target =""
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="MyPass"
Target.Offset(0, 2).Resize(1, 4).Value = ""
Target.Offset(0, 2).Resize(1, 4).Locked = True
If Not Range("K" & Target.Row).HasFormula Then
Do
r = r + 1
Loop Until Range("K" & r).HasFormula
Range("K" & r).Copy
Range("K" & Target.Row).PasteSpecial xlPasteFormulas
End If
Range("K" & Target.Row).Locked = True
ActiveSheet.Protect Password:="MyPass"
Application.EnableEvents = True
End If
End If
If Not Intersect(Target, Range("D
")) Is Nothing Then
If Target.Value = "Misc" Then
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="MyPass"
Target.Offset(0, 2).Locked = False
ActiveSheet.Protect Password:="MyPass"
Application.EnableEvents = True
ElseIf Target.Value <> "" Then
Application.EnableEvents = False
ActiveSheet.Unprotect Password:="MyPass"
Target.Offset(0, 7).Locked = False
ActiveSheet.Protect Password:="MyPass"
Application.EnableEvents = True
End If
End If
End Sub
Hopes this helps.