Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo ErrHandler:
Target.Calculate
If Selection.Cells.Count > 1 Then Exit Sub
If Target.Column = 6 Then oldDate = Target
If Target.Column = 7 Then oldDate = Target
If Target.Column = 8 Then oldDate = Target
If Target.Column = 9 Then oldDate = Target
If Target.Column = 11 Then oldDate = Target
If (GetKeyState(vbKeyShift) And KEY_MASK) <> 0 Then Exit Sub
xOldNLState = GetAsyncKeyState(VK_NUMLOCK)
xOldCLState = GetAsyncKeyState(VK_CAPITAL)
xOldSLState = GetAsyncKeyState(VK_SCROLL)
If Not Intersect(Target, Range("M4:M65536")) Is Nothing Then
SendKeys "{F2}"
If GetAsyncKeyState(VK_NUMLOCK) <> xOldNLState Then
Application.SendKeys "{NUMLOCK}"
End If
If GetAsyncKeyState(VK_CAPITAL) <> xOldCLState Then
Application.SendKeys "{CAPSLOCK}"
End If
If GetAsyncKeyState(VK_SCROLL) <> xOldSLState Then
Application.SendKeys "{SCROLLLOCK}"
SendKeys "{NUMLOCK}{NUMLOCK}"
End If
End If
If Target.Cells.CountLarge > 1 Then Exit Sub
If Not Intersect(Target, Range("A4:P65536")) Is Nothing Then
Range("A4:P65536").Interior.Color = xlNone
Range(Cells(Target.Row, "A"), Cells(Target.Row, "P")).Interior.Color = RGB(255, 215, 0)
Target.Interior.ColorIndex = 37
End If
If Target.Column = 17 Then
Target.Offset(0, -16).Select
End If
If Target.Column = 10 Then
If Range("L" & (ActiveCell.Row)).Value = "" Then
Target.Offset(0, 2).Select
Else
Target.Offset(0, -9).Select
End If
End If
What for? SENDKEYS is a last resort command and hardly ever necessary.