ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Togglebutton (https://www.excelbanter.com/excel-programming/414506-togglebutton.html)

ranswrt

Togglebutton
 
Is there a code that turns a toggle button on and off?
Thanks

FSt1

Togglebutton
 
hi
not sure what you mean exactly by on/off but maybe
on
togglebutton1.enabled = true
off
togglebutton1.enabled = false

post back to clairfy if i misunderstood.

Regards
FSt1


"ranswrt" wrote:

Is there a code that turns a toggle button on and off?
Thanks


ranswrt

Togglebutton
 
I was looking for a code that would change it from sunken to raised. When it
is sunken it would be on and raised it would be off. I inserted
togglebuttons on my worksheet using the control toolbox

"FSt1" wrote:

hi
not sure what you mean exactly by on/off but maybe
on
togglebutton1.enabled = true
off
togglebutton1.enabled = false

post back to clairfy if i misunderstood.

Regards
FSt1


"ranswrt" wrote:

Is there a code that turns a toggle button on and off?
Thanks


Rick Rothstein \(MVP - VB\)[_2376_]

Togglebutton
 
I would think you could just do this to "sink" it...

Worksheets("Sheet1").ToggleButton1.Value = True

where you would change the worksheet reference to you actual worksheet name
and, if you didn't use the default name for the ToggleButton, change it
also. By the way, setting the Value property to False to "raise" it.

Rick


"ranswrt" wrote in message
...
I was looking for a code that would change it from sunken to raised. When
it
is sunken it would be on and raised it would be off. I inserted
togglebuttons on my worksheet using the control toolbox

"FSt1" wrote:

hi
not sure what you mean exactly by on/off but maybe
on
togglebutton1.enabled = true
off
togglebutton1.enabled = false

post back to clairfy if i misunderstood.

Regards
FSt1


"ranswrt" wrote:

Is there a code that turns a toggle button on and off?
Thanks



ranswrt

Togglebutton
 
thank you

"Rick Rothstein (MVP - VB)" wrote:

I would think you could just do this to "sink" it...

Worksheets("Sheet1").ToggleButton1.Value = True

where you would change the worksheet reference to you actual worksheet name
and, if you didn't use the default name for the ToggleButton, change it
also. By the way, setting the Value property to False to "raise" it.

Rick


"ranswrt" wrote in message
...
I was looking for a code that would change it from sunken to raised. When
it
is sunken it would be on and raised it would be off. I inserted
togglebuttons on my worksheet using the control toolbox

"FSt1" wrote:

hi
not sure what you mean exactly by on/off but maybe
on
togglebutton1.enabled = true
off
togglebutton1.enabled = false

post back to clairfy if i misunderstood.

Regards
FSt1


"ranswrt" wrote:

Is there a code that turns a toggle button on and off?
Thanks





All times are GMT +1. The time now is 02:55 PM.

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