+ Reply to Thread
Results 1 to 1 of 1

ESCAPE ket to exit loop??

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    boston
    MS-Off Ver
    Excel 2010
    Posts
    42

    ESCAPE ket to exit loop??

    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
    Last edited by Leith Ross; 03-25-2013 at 08:28 PM. Reason: Added Code Tags

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1