title: Excel VBA Macro proper loop temination
body: <p>I have very little experience with VBA but have other programming experience. I have a loop that does write the correct data to the correct location. However, code after the loop is not completing. I believe I am not properly terminating the loop but have yet to figure out how to get it to end.</p>
  
  <pre><code>Dim i As Integer
  Dim j As Integer
  Dim TestInfo, PatID, TestCode, OAValue As String
  
  For i = 2 To 25
      Columns(i).Select
      If Cells(1, i).Value = 0 Then
          End
      Else
  
          For j = 2 To 52
              Rows(j).Select
              PatID = Cells(1, i).Value
              TestCode = Cells(j, 1).Value
              OAValue = Cells(j, i).Value
              TestInfo = PatID &amp; "," &amp; TestCode &amp; "," &amp; OAValue
              stream.WriteLine TestInfo
          Next j
      End
      End If
  Next i
  End
  
  stream.Close
  
  ActiveWorkbook.Close savechanges:=False
  </code></pre>
  
  <p>Any help would be greatly appreciated.
  Thank you in advance.</p>