title: How do I reference the checkbox of the userform with a variable
body: <p>Could anyone tell me how to reference a checkbox of the userform with a variable?</p>
  
  <p>For example I have something like these,</p>
  
  <pre><code>   if UserForm1.checkbox1.Value
     if UserForm1.checkbox2.Value 
     if UserForm1.checkbox3.Value
  </code></pre>
  
  <p>I have to check nearly 40 to 50 checkboxes. But writing the 40 to 50 statements like these is time consuming and also makes a bigger code.</p>
  
  <p>So I was kinda thinking to loop through them:</p>
  
  <pre><code> For i = 1 To 50 
     UserForm1.checkbox &amp; i .Value
   Next i
  </code></pre>
  
  <p>Something like that. I didn't find too much but I found it at the end. This is the link <a href="http://www.ozgrid.com/forum/showthread.php?t=43358" rel="nofollow">http://www.ozgrid.com/forum/showthread.php?t=43358</a> and the answer was like these,</p>
  
  <pre><code>UserForm1.Shapes("Checkbox" &amp; i).Value
  </code></pre>
  
  <p>But it isn't working. Does any one know the way to do it? Is it possible? Any help is greatly appreciated.</p>