You are on page 1of 1

Private Sub Worksheet_Change(ByVal Target As Range)

'UpdatebyExtendoffice20161221

    If Target.Address <> [C1].Address Then

       Exit Sub

    Else

       JumpToCell

 
    End If

End Sub

 
Sub JumpToCell()

    Dim xRg, yRg As Range

    Dim strAddress As String

    strAddress = ""

    Set yRg = Range("A2:A8")

    For Each xRg In yRg

    'MsgBox Cell.Value

        If xRg.Value = ActiveCell.Value Then

           strAddress = xRg.Address

        End If

    Next

    If strAddress = "" Then

       MsgBox "The Day You Selected in Cell D4 Was Not Found On " &
ActiveSheet.Name, _

        vbInformation, "Kutools for Excel"

       Exit Sub

    Else

       Range(strAddress).Offset(0, 1).Select

    End If

End Sub

You might also like