title: Conditional Loop in VBA using If, Then, Else, Else if statement not looping to next i in array
body: <p>I am trying to work on a conditional loop. Everything seems to be working, however it is not advancing to the next i and next j and continuing the loop. It seems to be ending after one loop of the loop. I have been working on this for quite sometime and am very very new to VBA. </p>
  
  <pre><code>Sub Read()
       NumMonth = 12
       Worksheets("Sheet1").Activate
       ReDim Month(1 To NumMonth)
       ReDim WCinit(1 To NumMonth)
       ReDim WC(1 To NumMonth + 1)
       ReDim Precip(1 To NumMonth)
       ReDim RefET(1 To NumMonth)
       ReDim Percolation(1 To NumMonth + 1)
       ReDim Runoff(1 To NumMonth + 1)
       For i = 1 To NumMonth
  
       Month(i) = Cells(4 + i, 1).Value
       WCinit(i) = Cells(4 + i, 10).Value
  
       Precip(i) = Cells(4 + i, 2).Value
       RefET(i) = Cells(4 + i, 3).Value
  
   Next i
  
  For j = 1 To NumMonth + 1
         WC(j) = Cells(3 + i, 11).Value
  Next j
  
       Application.ScreenUpdating = True
    End Sub
  
  
  Sub Test()
      Dim fc As Double
      fc = 0.3
      NumMonth = 12
      i = 1
      j = 2
  
      Dim pwp As Double
      pwp=0.1
      Dim dz As Double
      dz = 0.5 'm
  
  Do
  
  If WC(j - 1) + WCinit(i) &gt; pwp And fc - (WC(j - 1) + WCinit(i)) + RefET(i) &lt; Precip(i)        Then
     Runoff(i) = (Precip(i) - (fc - (WC(j - 1) + WCinit(i)) + RefET(i))) * 0.5
     Percolation(i) = (Precip(i) - (fc - (WC(j - 1) + WCinit(i)) + RefET(i))) * 0.5
     WC(j) = fc
  
  ElseIf WC(j - 1) + WCinit(i) &gt; pwp And fc - (WC(j - 1) + WCinit(i)) + RefET(i) &lt;    Precip(i) Then
     Runoff(i) = 0
     Percolation(i) = 0
     WC(j) = WC(j - 1) + WCinit(i) + Precip(i) - RefET(i)
  
  Else
     WC(j) = pwp
  
  End If
      j = j + 1
      i = i + 1
  
  Loop While j&lt;13
  </code></pre>