Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
hi guys,
I have a file consisting one command button and two option buttons.what I want to do is by pressing command button, I wanna choose the button that was nat chosen before,in other words,if option button 1 was chosen earlier now i need it be clear and the second option button be selected.I'm trying the following codes but it is not working: If Sheets("Request Form").OptionButton1.Value = True Then Sheets("Request Form").OptionButton2.Value = False Else If Sheets("Request Form").OptionButton1.Value = False Then 'Sheets("Request Form").OptionButton2.Value = True End If End If any comment? thanks, |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Are your option buttons from the Control Toolbox or the forms toolbar. In
either case there is no need for code to make the buttons mutually exclusive. If they are from the contol toolbox then do the following. Put the sheet into Design mode. Right click the option button and choose properties. On eo fth eperoperties is group. Make sure that the group names of the buttons match. If this is the case the the buttons will be mutually exclusive and clicking one will unclick the other. If your buttons come from the forms toolbar (right clicking the button does not give you a properties option then place a frame control (XYZ button) from the forms toolbar and place it around the two buttons. Now the buttons will be mutually exclusive... -- HTH... Jim Thomlinson "peyman" wrote: hi guys, I have a file consisting one command button and two option buttons.what I want to do is by pressing command button, I wanna choose the button that was nat chosen before,in other words,if option button 1 was chosen earlier now i need it be clear and the second option button be selected.I'm trying the following codes but it is not working: If Sheets("Request Form").OptionButton1.Value = True Then Sheets("Request Form").OptionButton2.Value = False Else If Sheets("Request Form").OptionButton1.Value = False Then 'Sheets("Request Form").OptionButton2.Value = True End If End If any comment? thanks, |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
that is from control toolbox.I'll check it out and let u know tommorow.
thanx "Jim Thomlinson" wrote: Are your option buttons from the Control Toolbox or the forms toolbar. In either case there is no need for code to make the buttons mutually exclusive. If they are from the contol toolbox then do the following. Put the sheet into Design mode. Right click the option button and choose properties. On eo fth eperoperties is group. Make sure that the group names of the buttons match. If this is the case the the buttons will be mutually exclusive and clicking one will unclick the other. If your buttons come from the forms toolbar (right clicking the button does not give you a properties option then place a frame control (XYZ button) from the forms toolbar and place it around the two buttons. Now the buttons will be mutually exclusive... -- HTH... Jim Thomlinson "peyman" wrote: hi guys, I have a file consisting one command button and two option buttons.what I want to do is by pressing command button, I wanna choose the button that was nat chosen before,in other words,if option button 1 was chosen earlier now i need it be clear and the second option button be selected.I'm trying the following codes but it is not working: If Sheets("Request Form").OptionButton1.Value = True Then Sheets("Request Form").OptionButton2.Value = False Else If Sheets("Request Form").OptionButton1.Value = False Then 'Sheets("Request Form").OptionButton2.Value = True End If End If any comment? thanks, |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Jim,
the group names are correct.but I need to do it by VB, by means of a Command Button.I don't know how to do it??are the codes bellow correct? thanx "Jim Thomlinson" wrote: Are your option buttons from the Control Toolbox or the forms toolbar. In either case there is no need for code to make the buttons mutually exclusive. If they are from the contol toolbox then do the following. Put the sheet into Design mode. Right click the option button and choose properties. On eo fth eperoperties is group. Make sure that the group names of the buttons match. If this is the case the the buttons will be mutually exclusive and clicking one will unclick the other. If your buttons come from the forms toolbar (right clicking the button does not give you a properties option then place a frame control (XYZ button) from the forms toolbar and place it around the two buttons. Now the buttons will be mutually exclusive... -- HTH... Jim Thomlinson "peyman" wrote: hi guys, I have a file consisting one command button and two option buttons.what I want to do is by pressing command button, I wanna choose the button that was nat chosen before,in other words,if option button 1 was chosen earlier now i need it be clear and the second option button be selected.I'm trying the following codes but it is not working: If Sheets("Request Form").OptionButton1.Value = True Then Sheets("Request Form").OptionButton2.Value = False Else If Sheets("Request Form").OptionButton1.Value = False Then 'Sheets("Request Form").OptionButton2.Value = True End If End If any comment? thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
option buttons | Excel Worksheet Functions | |||
Option Buttons | Excel Discussion (Misc queries) | |||
Option Buttons | Excel Discussion (Misc queries) | |||
Using 'Option Buttons' | Excel Discussion (Misc queries) | |||
yes/no option buttons | Excel Discussion (Misc queries) |