title: How do I have one Userform event procedure (checkbox click) control multiple IF THEN statements?
body: <p>Hey so I am a beginner with VBA but here is my dilemma:</p>
  
  <p>Creating an excel userform with VBA -</p>
  
  <p>I have a combobox with the numbers 1-8, the number of textboxes shown for the user to fill out is based off of the number selected in the combobox.</p>
  
  <p>I also have a checkbox which, when "TRUE", enables the user to create a custom title for the output of the textbox.</p>
  
  <hr>
  
  <p>Ex: 
  Number of Goals = <strong>2</strong><br>
  <em>Custom Label Goals? [x] (True</em>)</p>
  
  <p><strong>Goal 1</strong> : $1,000,000<br>
   <em>"New Home"</em></p>
  
  <p><strong>Goal 2</strong> : $50,000<br>
  "Boat"</p>
  
  <hr>
  
  <p>My issue is that I cannot get the number of custom label boxes to be the same as the number of goals selected. So when Number of goals is 2, 8 custom goal textboxes still show up if the checkbox is TRUE.</p>
  
  <p>I found a way using the code below, but when I enter the second IF THEN statement, the first no longer responds to the clicking the checkbox:</p>
  
  <pre><code>Private Sub cbIMPLBL_Click()
  
  If cboIMP.Value = "1" And cbIMPLBL.Value = "True" Then
     txtIMPLBL1.Visible = True
     txtIMPLBL2.Visible = False
     txtIMPLBL3.Visible = False
     txtIMPLBL4.Visible = False
     txtIMPLBL5.Visible = False
     txtIMPLBL6.Visible = False
     txtIMPLBL7.Visible = False
     txtIMPLBL8.Visible = False
  Else
     txtIMPLBL1.Visible = False
     txtIMPLBL2.Visible = False
     txtIMPLBL3.Visible = False
     txtIMPLBL4.Visible = False
     txtIMPLBL5.Visible = False
     txtIMPLBL6.Visible = False
     txtIMPLBL7.Visible = False
     txtIMPLBL8.Visible = False
  End If
  
  If cboIMP.Value = "2" And cbIMPLBL.Value = "True" Then
     txtIMPLBL1.Visible = True
     txtIMPLBL2.Visible = True
     txtIMPLBL3.Visible = False
     txtIMPLBL4.Visible = False
     txtIMPLBL5.Visible = False
     txtIMPLBL6.Visible = False
     txtIMPLBL7.Visible = False
     txtIMPLBL8.Visible = False
  Else
     txtIMPLBL1.Visible = False
     txtIMPLBL2.Visible = False
     txtIMPLBL3.Visible = False
     txtIMPLBL4.Visible = False
     txtIMPLBL5.Visible = False
     txtIMPLBL6.Visible = False
     txtIMPLBL7.Visible = False
     txtIMPLBL8.Visible = False
  End If
  
  End Sub
  </code></pre>
  
  <p>Any help here would be greatly appreciated. 
  As I am just beginning is there a different way I am supposed to be doing this, e.g. not writing all of this out individually, but as a control or function (not sure what the term would be) of some sort?</p>
  
  <p>Thank you so much!!!!</p>