ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Control button question (https://www.excelbanter.com/excel-programming/273495-control-button-question.html)

Peter Bugnet

Control button question
 
I have a number of buttons with VBA code linked to them
on a worksheet. All buttons do the same thing (format
some cells and copy some data from one sheet to another).
But two of the buttons, when another button is clicked
afterwards, change to a depressed picture. The code is
not triggered, just the graphical look of the button is
changed. Anyone have any ideas what causes this and how I
stop it?

Thanks

Bill Lunney

Control button question
 
Assuming we're talking about ActiveX type command buttons check the
TakeFocusOnClick property. I would ensure this property is set to false
unless you have a reason otherwise as it cures some side issue bugs. This
alone won't account for the behaviour you're suggesting so I would try:

- In design mode double click the button, enter some code in the click event
(Msgbox "hello" will do) exit design mode and press the button

You should see your code execute now. The button must be enabled in your
case as the control is taking focus in the first place which is normal.



--
Regards,


Bill Lunney
www.billlunney.com

"Peter Bugnet" wrote in message
...
I have a number of buttons with VBA code linked to them
on a worksheet. All buttons do the same thing (format
some cells and copy some data from one sheet to another).
But two of the buttons, when another button is clicked
afterwards, change to a depressed picture. The code is
not triggered, just the graphical look of the button is
changed. Anyone have any ideas what causes this and how I
stop it?

Thanks





All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com