[COLOR=navy]Sub[/COLOR] MG31Jul35
[COLOR=navy]Dim[/COLOR] Rng [COLOR=navy]As[/COLOR] Range, Dn [COLOR=navy]As[/COLOR] Range, n [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] K [COLOR=navy]As[/COLOR] Variant, oMax [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] c [COLOR=navy]As[/COLOR] [COLOR=navy]Long,[/COLOR] nStr [COLOR=navy]As[/COLOR] [COLOR=navy]String[/COLOR]
[COLOR=navy]Set[/COLOR] Rng = Range("C2", Range("C" & Rows.Count).End(xlUp))
[COLOR=navy]With[/COLOR] CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
[COLOR=navy]For[/COLOR] [COLOR=navy]Each[/COLOR] Dn [COLOR=navy]In[/COLOR] Rng
.Item(Dn.Value) = .Item(Dn.Value) + 1
[COLOR=navy]Next[/COLOR]
ReDim ray(1 To .Count + 1, 1 To 2)
c = 1
ray(1, 1) = "Carlines": ray(1, 2) = " Line Count"
[COLOR=navy]
For[/COLOR] n = 1 To .Count
oMax = Application.Large(.Items, n)
[COLOR=navy]For[/COLOR] [COLOR=navy]Each[/COLOR] K [COLOR=navy]In[/COLOR] .KEYS
[COLOR=navy]If[/COLOR] .Item(K) = oMax [COLOR=navy]Then[/COLOR]
[COLOR=navy]If[/COLOR] InStr(nStr, K) = 0 [COLOR=navy]Then[/COLOR]
nStr = nStr & K
c = c + 1
ray(c, 1) = K
ray(c, 2) = .Item(K) '[COLOR=green][B]remove this line if you Don't want the count[/B][/COLOR]
[COLOR=navy]End[/COLOR] If
[COLOR=navy]End[/COLOR] If
[COLOR=navy] Next[/COLOR] K
[COLOR=navy]Next[/COLOR] n
[COLOR=navy]End[/COLOR] With
Range("F1").Resize(c, 2).Value = ray
[COLOR=navy]End[/COLOR] [COLOR=navy]Sub[/COLOR]