title: VBA - Value of an option button in a frame (within an Excel sheet)
body: <p>I'm having problems with shapes, frames and option buttons... I'm a total newbie, I've never used them. I just put several option buttons on an Excel sheet (Using the FORM toolbox).</p>
  
  <p>I'm trying to check whether my optionbutton is filled or not. So far, I've done the following :</p>
  
  <pre><code>Sub SX_EXTERNE()
  
  Dim Ws As Worksheet
  Dim ConBut As Shape
  Dim Answer As String
  
  Set Ws = ThisWorkbook.Sheets("Externe")
  
  For Each ConBut In Ws.Shapes
      If ConBut.Type = msoFormControl Then
          If ConBut.FormControlType = xlOptionButton Then
              If ConBut.ControlFormat.Value = xlOn Then
                   Answer = ConBut.Name
              End If
          End If
      End If
  Next ConBut
  
  MsgBox Answer
  
  End Sub
  </code></pre>
  
  <p>My problem is I do not know how to check only in a selected frame (i.e. "Conges_generaux" for my example):</p>
  
  <p><a href="https://i.stack.imgur.com/u2aKj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u2aKj.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/dEU0E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dEU0E.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/6Eyhs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Eyhs.png" alt="enter image description here"></a></p>
  
  <p>Could you please give me a hint? I've seen many subjects about that but many of them treat of ActiveXControls... I don't even know the difference.</p>
  
  <p>Thanks</p>