Command Buttons

A

ADK

After the user clicks the command button and
the code executes, the button is still focused.
In code I only know to place Range("A7").Select to unfocus the button.
Without this line the button remains focused. If you press the Esc key it
unfocuses. I would like the result to be similar to the Esc key with having
to select a cell. Possible? How?
 
R

Rick Rothstein \(MVP - VB\)

After the user clicks the command button and
the code executes, the button is still focused.
In code I only know to place Range("A7").Select to unfocus the button.
Without this line the button remains focused. If you press the Esc key it
unfocuses. I would like the result to be similar to the Esc key with
having
to select a cell. Possible? How?

A kludge solution would be to add this line as the **last** line of your
Click event code...

SendKeys "{ESC}"

but I see nothing wrong with the "select a cell" method where you would make
this your **last** line of code...

ActiveCell.Select

Rick
 

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