I am using this and it works fine:
But now I want to add some if statements to make the user have to type in specific codes for it to trigger. Right now as long as they type anything into column E, it will trigger column I and K to auto-fill "TEST" and "Stuff".
How would I change this VBA so that if the user types "1234" into column E for example, only then will it trigger to auto-fill column I and K?
I would also like it if the user types anything other than "1234" or deletes it to leave column E blank, then columns I and K, for that row, will go back to being null or blank.
Thank you for your help on this.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If Not Intersect(Range("E:E"), .Cells) Is Nothing Then
Application.EnableEvents = False
With Range("K" & Target.Row)
ActiveSheet.Unprotect Password:="hello"
.Value = "TEST"
With Range("I" & Target.Row)
.Value = "Stuff"
ActiveSheet.Protect Password:="hello"
End With
End With
Application.EnableEvents = True
End If
End With
End Sub
But now I want to add some if statements to make the user have to type in specific codes for it to trigger. Right now as long as they type anything into column E, it will trigger column I and K to auto-fill "TEST" and "Stuff".
How would I change this VBA so that if the user types "1234" into column E for example, only then will it trigger to auto-fill column I and K?
I would also like it if the user types anything other than "1234" or deletes it to leave column E blank, then columns I and K, for that row, will go back to being null or blank.
Thank you for your help on this.