Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Formula for using check boxes
If this has been asked before, sorry for a repeat. In a form I' creating
that will be later imported to Access, some sections I have uses check boxes. I'm very new to excel, especially using formulas. For check boxes, like a Yes and No, if a person checks Yes, I would like the cell to prevent the No box from being check and vice-versa. Also for check boxes with multiple choices, if they check 3 items, I would like all 3 text's to appear in the data field that will later be exported to Access. Is there a way to do this? Thank you |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Formula for using check boxes
Hell-fi
It sounds like what you want in your Yes/No example is a optionbutton. It's a little annoying to be prevented changing your mind in the middle of using a form, so using a checkbox and preventing a change is possible, but probably not the best. You can have several optionbuttons on the form. In the properties of the optionbutton, you can set a groupname. So, for example: with two questions you can have four optionbuttons Optionbutton1 with caption "Yes" and groupname "Question1" Optionbutton2 with caption "No" and groupname "Question1" Optionbutton3 with caption "Yes" and groupname "Question2" Optionbutton4 with caption "No" and groupname "Question2" .... If you click Yes for question1, you can also click yes for question2. If you change your mind on question1, you can click No... then optionbutton2 value becomes "true" and optionbutton1's value automatically becomes "false" Also, use the properties to set the default value if you so choose. On your second question: Checkbox1 = "Include this" Checkbox2 = "text" Checkbox3 = "pig" Checkbox4 = "in my" Checkbox5 = "car" Checkbox6 = "worksheet" When you want to add the results of the checkboxes to a cell on the worksheet: Dim myoutput as string If checkbox1 = true then myoutput = myoutput & checkbox1.caption & " " If checkbox2 = true then myoutput = myoutput & checkbox2.caption & " " If checkbox3 = true then myoutput = myoutput & checkbox3.caption & " " If checkbox4 = true then myoutput = myoutput & checkbox4.caption & " " If checkbox5 = true then myoutput = myoutput & checkbox5.caption & " " If checkbox6 = true then myoutput = myoutput & checkbox6.caption & " " myoutput = left(myoutput, len(myoutput)-1) myoutput = myoutput & "." Msgbox myoutput If you check boxes 1, 3, 4, and 5 you should get a message: "Include this pig in my car." If you check boxes 1, 2, 4, and 6 you should get a message: "Include this text in my worksheet." If you checkboxes 2,3,6 you should get a message "text pig worksheet." which is admittedly nonsensical, but, you should get the idea. Hope this helps. Unfortunately, I can't comment on how the form or data will perform under Access's environment, nor can I comment on how to import data or anything else with Access, although the environments are similar. drhalter "Hell-fire" wrote: If this has been asked before, sorry for a repeat. In a form I' creating that will be later imported to Access, some sections I have uses check boxes. I'm very new to excel, especially using formulas. For check boxes, like a Yes and No, if a person checks Yes, I would like the cell to prevent the No box from being check and vice-versa. Also for check boxes with multiple choices, if they check 3 items, I would like all 3 text's to appear in the data field that will later be exported to Access. Is there a way to do this? Thank you |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Check All Boxes | Excel Discussion (Misc queries) | |||
How do I increase the size of check in check boxes | Excel Discussion (Misc queries) | |||
Enable check box in protected sheet + group check boxes | Excel Discussion (Misc queries) | |||
How do i create a value for check boxes or option boxes | Excel Discussion (Misc queries) | |||
Creating Formula using check boxes | Excel Discussion (Misc queries) |