command button problem

rede96

Registered User.
Local time
Today, 20:15
Joined
Apr 2, 2004
Messages
134
I have put a command button onto a worksheet. It is just a normal command button not a toggle button.

I've written some code and the button executes the code as exepected.

The problem is that when the mouse moves focus from the button, the button depresses and stays pressed down. Although it doesn't run the code again, it looks wrong!

The button operates as normal when pressed, i.e. it depresses then comes back up again. But no matter what I do, once I move the mouse away from the button is stays in the ‘down’ position.

Can anyone help please?

(I am using excel 2003)
 
You can actually use this code:

commandbutton_Click
[All your code..........]
Sheet1.cells(1,1).select
End Sub

Here I have used Sheet1.cells(1,1)....but you can use your own spreadsheet name and the cells that you desire to....
With this, the focus of the cursor goes to the desired cell when the commandbutton is clicked besides performing all the actions that you have written in code for this button.
 
You can actually use this code:



Here I have used Sheet1.cells(1,1)....but you can use your own spreadsheet name and the cells that you desire to....
With this, the focus of the cursor goes to the desired cell when the commandbutton is clicked besides performing all the actions that you have written in code for this button.


Thanks MI man, that works.:)
 

Users who are viewing this thread

Back
Top Bottom