Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default option button?

i have an option button on sheet1 that was created
with the forms toolbar.

how do i toggle the state of button the from within a macro.

(the option button name is "Option Button 57")

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default option button?

Hi Pete,

Try:

Sub AAA()
With ActiveSheet.OptionButtons("Option Button 57")
If .Value = xlOn Then
.Value = xlOff
Else
.Value = xlOn
End If
End With
End Sub



---
Regards,
Norman



"Pete" wrote in message
...
i have an option button on sheet1 that was created
with the forms toolbar.

how do i toggle the state of button the from within a macro.

(the option button name is "Option Button 57")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default option button?

Hi Pete,

Or, more concisely,

Sub AAA2()
With ActiveSheet.OptionButtons("Option Button 57")
.Value = Not .Value = xlOn
End With
End Sub

---
Regards,
Norman



"Norman Jones" wrote in message
...
Hi Pete,

Try:

Sub AAA()
With ActiveSheet.OptionButtons("Option Button 57")
If .Value = xlOn Then
.Value = xlOff
Else
.Value = xlOn
End If
End With
End Sub



---
Regards,
Norman



"Pete" wrote in message
...
i have an option button on sheet1 that was created
with the forms toolbar.

how do i toggle the state of button the from within a macro.

(the option button name is "Option Button 57")





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
option button ? Dan Excel Discussion (Misc queries) 6 December 27th 07 08:42 PM
keep source formatting is not an option in paste option button Tina Excel Discussion (Misc queries) 0 February 20th 06 09:58 PM
Option Button ceemo[_17_] Excel Programming 2 August 26th 05 04:58 PM
option button Mario Excel Discussion (Misc queries) 1 July 26th 05 07:44 PM
VBA - Option Button ajliaks[_19_] Excel Programming 1 May 5th 04 02:56 AM


All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"