+ Reply to Thread
Results 1 to 2 of 2

optionbutton

  1. #1
    benb
    Guest

    optionbutton

    What code would I use to return which optionbutton within a given frame is
    checked (true)? I've tried using a for each loop but I can't figure out the
    correct collection to use. I'm new to userforms (if that's not already
    obvious). Thanks for the help.

  2. #2
    Tom Ogilvy
    Guest

    Re: optionbutton

    Dim ctrl as Control
    Dim oBtn as MSForms.OptionButton
    for each ctrl in Userform.Frame1.controls
    if type of ctrl is MSForms.OptionButton then
    if ctrl.Value = true then
    msgbox ctrl.name
    set oBtn = ctrl
    exit for
    End if
    end if
    Next


    --
    Regards,
    Tom Ogilvy


    "benb" <benb@discussions.microsoft.com> wrote in message
    news:8D57F5AB-1615-4B9B-9EEE-4AFEE6C8CBD0@microsoft.com...
    > What code would I use to return which optionbutton within a given frame is
    > checked (true)? I've tried using a for each loop but I can't figure out

    the
    > correct collection to use. I'm new to userforms (if that's not already
    > obvious). Thanks for the 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