title: How to make the Combobox item list dynamic?
body: <p>I am using a 'Generate' button on my worksheet. When I click on the button, a popup (form) come, which contains two comboboxes. Basis the selection in the first combobox, the second combobox option list is populated. </p>
  
  <p>For the first combobox, when I hardcode the item values it works fine. The form code is as follows: </p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
  With ComboBox_DL
      .AddItem "DL1"
      .AddItem "DL2"
  End With
  
  End Sub
  </code></pre>
  
  <p>I tried to make this item list dynamic by fetching the combobox item values from a column the in the excel worksheet using the following form code: </p>
  
  <pre><code>Private Sub UserForm_Initialize()
  
  With ComboBox_DL
  For Each c In ActiveSheet.Range(Range("AE"), Range("AE").End(xlDown))
   .AddItem c.Value
  Next
  End With
  
  End Sub
  </code></pre>
  
  <p>But the above code throws error: Run time error '1004': Method 'Range' of object '_Global' failed</p>
  
  <pre><code>I modified the code adding sheet details: 
  With ComboBox_DL
      For Each c In ThisWorkbook.Worksheets("Business_Input_Data").Range(Range("AE"), Range("AE").End(xlDown))
          .AddItem c.Value
  Next
  </code></pre>
  
  <p>It still throws the same error. </p>
  
  <p>Can someone help please? Also, I want to know how to look up the values corresponding to the selection in combobox1 and populate the list in combobox2?</p>