A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
You don't need VBA for that In B2:
=COUNTIF($A$2:$A$22,A22)
Fill down.
If you really want to use VBA:
Sub Test()
With Range("B2:B22")
.Formula = "=COUNTIF($A$2:$A$22,A2)"
.Value = .Value
End With
End Sub
