title: Making "Countif" worksheet function variable
body: <p>I have a code that counts the cell in a range if there's a number. The total number of cell counted will then be shown in row 3. My issue now is that the formula is not variable and I have no idea how to make it too.
  If I enter this code, row 3 reports all the same result (which is from the first column of data). Hoping somebody can help me here!!</p>
  
  <pre><code>Sub Six_Continue()
  
      Dim Rng As Range
      Dim LastClm As Long
  
  
      With ActiveSheet
          LastClm = .Cells(1, .Columns.Count).End(xlToLeft).Column
          Set Rng = Range(.Cells(3, 3), .Cells(3, LastClm))
          Rng.Value = Application.WorksheetFunction.CountIf(Range("C5", "C" &amp; Cells(Rows.Count, 5).End(xlUp).Row), "&lt;&gt;?")
      End With
  
  End Sub
  </code></pre>