Re: Counting Loop
You could also use this code
Code
Sub Macro1()
Rows("2:2").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("B2").FormulaR1C1 = "=COUNTIF(R2C1:RC[-1],RC[-1])"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:B" & ActiveSheet.UsedRange.Rows.Count)
End Sub