title: Excel VBA: Read 10 rows of data, run conditional loop, and Print output values
body: <p>I am trying to read in values into a sub function, run a conditional loop, then print the output values in the worksheet. However, I am running into some problems. In the sub function infiltPrint I cannot seem to get the values to print in the cells.</p>
  
  <pre><code>Option Explicit
  
  Dim dz() As Double
  Dim WC() As Double
  Dim fc() As Double
  Dim NL, i As Integer
  
  Dim sumdrain As Double
  Dim infl As Double
  
  
  Sub main()
      Call InfiltRead
      Call infilt
      Call Infiltprint
  End Sub
  
  
  Sub InfiltRead()
      Dim dz() As Double
      Dim WC() As Double
      Dim fc() As Double
      Dim NL, i As Integer
      Dim sumdrain As Double
      sumdrain = 0
      Dim infl As Double
  
  'read inputs 
      NL = 10
      infl = Cells(2, 1)
  
      Application.ScreenUpdating = False
      Worksheets("Sheet1").Activate
  
      ReDim dz(NL)
      ReDim WC(NL)
      ReDim fc(NL)
  
      For i = 1 To NL
          dz(i) = Cells(1 + i, 3)
          WC(i) = Cells(1 + i, 7)
          fc(i) = Cells(1 + i, 5)
      Next i    
  End Sub
  
  
  Sub infilt()
      Dim j As Integer
      j = 1
      While (infl &gt; 0) And (j &lt;= NL)
          If infl &gt; (fc(i) - WC(j)) * dz(j) Then
              infl = infl - (fc(i) - WC(j)) * dz(j)
              WC(j) = fc(i)
          Else
              WC(j) = WC(j) + infl / dz(j): infl = 0
          End If
          j = j + 1
      Wend
      If infl &gt; 0 Then
          sumdrain = sumdrain + infl
          infl = 0
      End If
  End Sub
  
  
  Sub Infiltprint()
      Dim col As Double
      Dim rw As Double
      col = 7
      For rw = 2 To 11
          Cells(rw + 1, col).Value = WC()
      Next rw
  End Sub
  </code></pre>
  
  <p>I keep getting a Type Mismatch in the line " Cells(Row + 1, col) = WC()"</p>
  
  <p>I know this probably this isn't the only error in my code. Frankly, I have no clue how to print my values from the infilt sub. I attempted to use a sub main...</p>