How do I include the option for the user to exit the below loop with the ESCAPE key?
Do While Not IsEmpty(Cells(i, 1))
div = Cells(i, 1)
lne = Cells(i, 2)
'Application.Wait Now + TimeValue("00:00:01")
Sleep 1000
SendKeys div
SendKeys "{ENTER}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys lne
SendKeys "{TAB}", True
SendKeys "{ENTER}", True
Sheets("Sheet1").Select
Range("A" & i & ":B" & i).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
.PatternTintAndShade = 0
End With
'InteriorColor = ActiveCell.Interior.ColorIndex
Call SetCursorClickRight(Right_X, Right_Y)
'Application.Wait Now + TimeValue("00:00:01")
Call SetCursorClickLeft(Left_X, Left_Y)
i = i + 1
num = num + 1
Loop
Bookmarks