Home > database >  Autofill Value in a cell based on other cell
Autofill Value in a cell based on other cell

Time:08-28

Is there any way to get a specific value "66" in "B1" when I Put Text "Ok" in "A1" without entering Formula in "B1"

CodePudding user response:

You can try Worksheet_Change event. Try below codes.

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Application.Intersect(Target, Range("B1")) Is Nothing Then
        If Val(Target.Value) = 66 Then
            Range("A1") = "Ok"
        End If
    End If
End Sub
  • Related