title: Loop through Excel Ranges Filling Combobox VB.Net
body: <p>I have a program that needs to iterate through a very large excel range, to combine two ranges into one combo box value. I have the following code to do so, but all it does is iterate the first value five times. If I remove the first FOR loop, then it simply only returns the first value and never completes. Any suggestions on what I can do to polish this code up and get it working?</p>
  
  <pre><code>        Dim i As Integer
      If TenantBox.SelectedItem = "CNS" Then
          WFMBook.Workbooks.Open("C:\Schedule.xlsx")
          For i = 0 To 5 Step +1
              For Each CNSCell In WFMBook.Range("A3:A1441").Cells
                  f = CNSCell.Value.ToString
              Next
              For Each tst In WFMBook.Range("B3:B1441").Cells
                  l = tst.Value.ToString
              Next
              ComboBox1.Items.Add(f + " " + l)
              If (i = 5) Then
                  Exit For
              End If
              Console.WriteLine(i)
          Next
      End If
  </code></pre>