title: Loop through a range to execute countif function
body: <p>I have some data in my active workbook's <em>sheet number 3</em>. <em>Column A</em> contains unique value. I want to count the number of times each values exist in <em>Column A</em>.</p>
  
  <p>I have written the following code but something is horribly wrong with my logic. Please help me to sort out the issue. </p>
  
  <pre><code>Sub cuntef()
      ThisWorkbook.Sheets("sheet3").Activate
      For i = 2 To 13
  
           ActiveSheet.Range("C" &amp; i).Value = _
               Application.WorksheetFunction.CountIf _
               (ActiveSheet.Range("A" &amp; i), ActiveSheet.Range("A" &amp; i))
  
      Next
  End Sub
  </code></pre>