title: Countif until the last row in specific column is populated
body: <p>I have a problem with finishing my macro. It uses the COUNTIF function and checks the whole A column (A:A - no exclusions) against the data from B2. I would like to make the autofill in the C column until the last value in the B column - just like presented on the picture below:</p>
  
  <p><img src="https://i.stack.imgur.com/XRI9f.jpg" alt="enter image description here"></p>
  
  <p>Could anyone help me what should I add to my code to make this autofill possible??</p>
  
  <pre><code>Sub Countif()
  
  Range("C2").Select
  ActiveCell.FormulaR1C1 = "=COUNTIF(C[-2],RC[-1])"
  Selection.AutoFill Destination:=Range("C2:C10"), Type:=xlFillDefault
  Range("C2:C10").Select
  
  End Sub
  </code></pre>