title: How to make a loop pull values from another sheet?
body: <p>I'm trying to create a loop that pulls values from another sheet in the workbook.</p>
  
  <pre><code>For i = 3 To 1000
  
      Worksheets("Cable Estimate").Select
  
      If Cells(i, 1) = "" Then
  
          If Equipment = "Station Service Transformer" Then Worksheets("Equipment List").Range("A2:D9").Copy Worksheets("Cable Estimate").Range(Cells(i, 1), Cells(i, 4))
  
          Exit For
  
          If Equipment = "13kV PTs (3 phase)" Then Worksheets("Equipment List").Range("A11:D15").Copy Worksheets("Cable Estimate").Range(Cells(i, 1), Cells(i, 4))
  
          Exit For
  
          If Equipment = "13kV Tie Breaker" Then Worksheets("Equipment List").Range("A18:D26").Copy Worksheets("Cable Estimate").Range(Cells(i, 1), Cells(i, 4))
  
          Exit For
  
       End If
  
  Next i
  </code></pre>
  
  <p>The "Equipment" variable is set to equal a combo box value which is a list of material populated from another sheet. The exit for is listed under each piece of equipment such that the command only pulls the data from the other worksheet once.</p>
  
  <p>When "Station Service Transformer" is selected (the first value in the combobox) the code pulls correctly into my sheet, however the code does not pull correctly any of the following equipment below that one. I believe I'm missing something either before or after each "exit for" statement. I also believe it may need some extra code like an "else if" if the cell value is not blank as in the first condition <code>If Cells(i, 1) = "" Then</code>.</p>
  
  <p>Sidenote: I made the formula work by creating a separate <code>for i = 3 to 1000</code> and placing an "exit for" and "end if"  for each piece of equipment but I was hoping to make it all work under one "i".</p>