Closed Thread
Results 1 to 3 of 3

How to handle "Enter" key pressed against a cell?

  1. #1
    im_chc
    Guest

    How to handle "Enter" key pressed against a cell?

    Hi,

    I am developing an application which uses Excel as the input interface.
    I want to use a cell as a "button", i.e. the user can use keyboard to
    navigate to that cell, and press enter to "click" the button. I don't
    want to use a button clicked by mouse, because that would be slow.

    However, I can't find any event like "onkeypressed", and
    "worksheet_change" and "worksheet_selectionchange" doesn't do well.
    What should I do?

    Thanks in advance.

    David Chan


  2. #2
    Anne Troy
    Guest

    Re: How to handle "Enter" key pressed against a cell?

    Many people would disagree with you about what's easier, but why don't you
    just assign a shortcut key to the macro? Like Ctrl+Shift+R or something?
    ************
    Hope it helps!
    Anne Troy
    www.OfficeArticles.com

    "im_chc" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I am developing an application which uses Excel as the input interface.
    > I want to use a cell as a "button", i.e. the user can use keyboard to
    > navigate to that cell, and press enter to "click" the button. I don't
    > want to use a button clicked by mouse, because that would be slow.
    >
    > However, I can't find any event like "onkeypressed", and
    > "worksheet_change" and "worksheet_selectionchange" doesn't do well.
    > What should I do?
    >
    > Thanks in advance.
    >
    > David Chan
    >




  3. #3
    im_chc
    Guest

    Re: How to handle "Enter" key pressed against a cell?

    Hi,

    Thx for the reply, but however, remember that what I want to achieve is
    to use Excel as a front end, and the handling code is in a VB program
    instead of in the excel file as VBA.

    It's kind of like having a VB program running in the background, and it
    fires off Excel, create a worksheet and displays all database values on
    the sheet. The user works on the sheet and then he pressed a button and
    then the changes are brought back to the database.

    Now instead of using a mouse to click a button, I want the user to be
    able to move the cursor to a specific cell, which is already "painted"
    by the VB program as a highlighted cell (disguised as a "button"), and
    then press enter.

    I hope I have made myself clear. Hope that someone can help.

    Regards,
    David Chan


Closed 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