title: Re-setting all option buttons at once
body: <p>I have written a code for re-setting all option button on one click but its giving an error, "object doesnt support the property or matter".</p>
  
  <pre><code>Sub Add_New_Record()
  Dim i As Integer
  For i = 1 To 30
      With Sheets("Form")
          '-- unlock the worksheet
          .Unprotect
          .OptionButton(i).Value = False
  
          '-- lock the worksheet
          '.Protect
  
          .Activate
          .Range("Q12").Select
       End With
       Next i
  End Sub
  </code></pre>
  
  <p>Can anyone please suggest me how to fix the code and make the value of all option buttons "false" at one. </p>
  
  <p>I know how to do it individually like:</p>
  
  <pre><code>Sub Add_New_Record()
      With Sheets("Form")
          '-- unlock the worksheet
          .Unprotect
          .OptionButton1.Value = False
  
          '-- lock the worksheet
          '.Protect
          .Activate
          .Range("Q12").Select
       End With
  End Sub
  </code></pre>
  
  <p>but since I have too many buttons, the code will get really long and inefficient.</p>
  
  <p>Thanks for your help and time.</p>