Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check box in user form
Hi I have a user form with 2 check box, but i need help with some code I want a error message to appear if box boxes are ticked or both are not Also how do unload check boxes and option buttons so after closing the next person using the form has no choice but to select one (this is in case someone select a option but the next person forgets to and leaves the option before which is the wrong one for them!!!!) Hope that makes sense here is some of my code already If Not (OptionButton6 Or OptionButton7) Then MsgBox "No option for job type track only or compelet, please select." OptionButton6.SetFocus Exit Sub Thanks -- raw ------------------------------------------------------------------------ raw's Profile: http://www.excelforum.com/member.php...o&userid=28312 View this thread: http://www.excelforum.com/showthread...hreadid=480443 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check box in user form
"raw" wrote in message ... I have a user form with 2 check box, but i need help with some code I want a error message to appear if box boxes are ticked or both are not Private Sub CheckBox1_Click() With Me If .CheckBox1.Value = .CheckBox2.Value Then MsgBox "Can't both be set/unset" .CheckBox1.Value = Not .CheckBox2.Value End If End With End Sub Private Sub CheckBox2_Click() With Me If .CheckBox1.Value = .CheckBox2.Value Then MsgBox "Can't both be set/unset" .CheckBox2.Value = Not .CheckBox2.Value End If End With End Sub Trouble with this is that once you set one or other, you can never change it as any other action triggers the error. Also how do unload check boxes and option buttons so after closing the next person using the form has no choice but to select one (this is in case someone select a option but the next person forgets to and leaves the option before which is the wrong one for them!!!!) Hope that makes sense Public Sub UserForm_Activate() With Me .CheckBox1.Value = False .CheckBox2.Value = False End With End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Check box in user form
Hello Raw, You neeed to change the *OR* to *XOR*. If Not (OptionButton6 Xor OptionButton7) Then Sincerely, Leith Ros -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=48044 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
make a check form, and then have info go to a check register | Excel Worksheet Functions | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming | |||
I am looking to see if anybody has an equivalant user form to Outlooks CONTACT form | Excel Programming |