Share via

How to execute a key function of keyboard by using excel vba ?

Anonymous
2010-09-11T08:28:59+00:00

How to execute a key function of keyboard by using excel vba ?

Instead of using finger press a key from keyboard, it is able to use excel VBA code?

Example like pressing "Esc" key.

my problem is after select a range of cell copy and paste to other worksheet, the previous cell that select still remain selected and the status bar of excel07 still show

"Select destination and press ENTER or choose Paste"

i have to press "Esc" key to make the message gone.

is there anyway to simulate let pressing "Esc" key by using VBA code?

Thank!  ^|^

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2010-09-11T08:57:04+00:00

    Hi,

    Use this instead of sendkeys, it goes in your code after the paste operation

    Application.CutCopyMode = False


    If this post answers your question, please mark it as the Answer.

    Mike H

    7 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2010-09-11T10:49:32+00:00

    your welcome and thanks for the feedback


    If this post answers your question, please mark it as the Answer.

    Mike H

    0 comments No comments
  2. Anonymous
    2010-09-11T10:44:52+00:00

    Hi Mike,

    Thank again. :-)

    0 comments No comments
  3. Anonymous
    2010-09-11T09:22:46+00:00

    Hi Mike,

    Thank for the solution! :-)

    It solve my problem.

    It seen like my question title not appropriate.....

    But just for curious, is there any way execute keyboard function with vba???

    0 comments No comments