+ Reply to Thread
Results 1 to 10 of 10

Option Group Box question

  1. #1
    Registered User
    Join Date
    01-23-2007
    Posts
    8

    Option Group Box question

    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?

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    If you test all the boxes for a value of TRUE then you will know if one is selected
    Martin

  3. #3
    Registered User
    Join Date
    01-23-2007
    Posts
    8
    Thanks Martin, I'm a novice at this type thing in excel so could you explain how I do that?

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    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?

  5. #5
    Registered User
    Join Date
    01-23-2007
    Posts
    8
    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.

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Can you send the workbook as an attachment so that we can see exactly what you have done - your description is a little ambiguous.

  7. #7
    Registered User
    Join Date
    01-23-2007
    Posts
    8

    Talking

    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!!!

  8. #8
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Zipping works best.

  9. #9
    Registered User
    Join Date
    01-23-2007
    Posts
    8
    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.
    Attached Files Attached Files

  10. #10
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    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?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1