If you have 5 option boxes in the group at the top of a form and want to make sure the user of the form selects at least one box before continuing on, how do you do that?
If you have 5 option boxes in the group at the top of a form and want to make sure the user of the form selects at least one box before continuing on, how do you do that?
If you test all the boxes for a value of TRUE then you will know if one is selected
Martin
Thanks Martin, I'm a novice at this type thing in excel so could you explain how I do that?
I was suggesting something like the following on the code page associated with your user form
Sub Test()
Dim ValueSelected As Boolean
ValueSelected = False
If Me.OptionButton1.Value = True Then ValueSelected = True
If Me.OptionButton2.Value = True Then ValueSelected = True
If Me.OptionButton3.Value = True Then ValueSelected = True
If Me.OptionButton4.Value = True Then ValueSelected = True
If Me.OptionButton5.Value = True Then ValueSelected = True
If ValueSelected = True Then
....
ElseIf ValueSelected = False Then
.......
End If
End Sub
Am I correct in thinking that you are using a userform or have you actually just got option buttons pasted onto a worksheet?
Thanks so much for the response. I think I'm just in over my head. I've never done any type programming ever so this is all Greek to me.
All I did was insert 5 option boxes withing a group box up at the top of my form. I just want to make sure the user marks at least one box before moving on in the form.
Can you send the workbook as an attachment so that we can see exactly what you have done - your description is a little ambiguous.
Martin, that would be great! I would love for someone to look at it to see what I'm looking for. I'm having a hard time describing it and probably making it seem harder than it needs to be.
It's on my work computer, but I've been still trying to figure it out over the weekend. I will attach tomorrow. I wish I had it at home to attach now.
I see down below where I have the option of 'Manage Attachments'. What's the best way to do this? I don't see excel as an option.
Do I PDF it? Can I zip it?
Thanks so so much!!!
Zipping works best.
Thanks guys for any help. I so appreciate you looking over. Sorry I'm not so good at explaining.
The finished form will be going on our website. I just want people to be able to go into the form and fill it in. I would love for them to be able to tab from place to place. Thanks again so much.
This helps.
I'm not sure how you got the check boxes into the form that you have. It looks like they are grouped.
A simple way forward is to create new checkboxes from the forms toolbar in Excel and link them to a cell that's out of sight. A MAX function on the linked cells will give a 1 if at least one of the boxes is selected.
Does this help?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks