Results 1 to 3 of 3

VBA for Escape key

This is a discussion on VBA for Escape key within the Excel Questions forums, part of the Question Forums category; How do I do the equivalent of hitting the escape key in VBA ? When I do a copy and ...

  1. #1
    Board Regular
    Join Date
    Jul 2009
    Posts
    58

    Default VBA for Escape key

    How do I do the equivalent of hitting the escape key in VBA?

    When I do a copy and paste in VBA, on screen in the spreadsheet it leaves the section highlighted or outlined. I do not want to see that residual outline of the area I copied or pasted. In normal usage, I would just hit the escape key to deselect the highlighted cells. How do I do that in VBA?

  2. #2
    Board Regular
    Join Date
    Apr 2004
    Location
    Still in Kansas
    Posts
    367

    Default Re: VBA for Escape key

    For a workaround, add this at the end:

    Range("A1").ClearOutline

  3. #3
    Board Regular
    Join Date
    Apr 2004
    Location
    Still in Kansas
    Posts
    367

    Default Re: VBA for Escape key

    Or this is more like it:

    SendKeys ("{ESC}")

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com