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

I

im_chc

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
 
A

Anne Troy

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
 
I

im_chc

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top