title: vba get true radio button val from group
body: <p>In Excel VBA:</p>
  
  <p>I'm creating a form. This form has several radio button groups, some of which have many options (but only one radiobutton can be true per group).  I would like to be able to get the name of the radiobutton that's "true" per group, instead of having to check every radio button's condition.</p>
  
  <p><strong>For example:</strong></p>
  
  <p>FAMILY A</p>
  
  <ul>
  <li>Option1 - F</li>
  <li>Option2 - T</li>
  </ul>
  
  <p>FAMILY B</p>
  
  <ul>
  <li>Option11 - F</li>
  <li>Option12 - F</li>
  <li>Option13 - F</li>
  <li>Option14 - F</li>
  <li>Option15 - T</li>
  </ul>
  
  <hr>
  
  <p><strong>What I have to do</strong>: </p>
  
  <ul>
  <li>Is Option1 True?  </li>
  <li>Is Option2 True?  (yes... so Option2 for Family A)</li>
  <li>Is Option11 True?  </li>
  <li>Is Option12 True?  </li>
  <li>Is Option13 True?  </li>
  <li>Is Option14 True?  </li>
  <li>Is Option15 True?  (yes... so Option15 for Family B)</li>
  </ul>
  
  <p><strong>What I would like to do</strong>:  </p>
  
  <ul>
  <li>What button is True for Family A? (Option2)</li>
  <li>What button is True for Family B? (Option15)</li>
  </ul>
  
  <hr>
  
  <p>Is this possible? </p>
  
  <p>Thanks for looking!</p>
  
  <p><strong>EDIT:</strong>
  Solution! Based on David's advice below:</p>
  
  <pre><code>Dim ctrl As MSForms.Control
  Dim dict(5, 1)
  Dim i
  
  '## Iterate the controls, and associates the GroupName to the Button.Name that's true.
  
  For Each ctrl In Me.Controls
      If TypeName(ctrl) = "OptionButton" Then
          If ctrl.Value = True Then
              dict(i, 0) = ctrl.GroupName
              dict(i, 1) = ctrl.Name
              i = i + 1
          End If
      End If
  </code></pre>