[COLOR="Navy"]Sub[/COLOR] MG24Aug11
[COLOR="Navy"]Dim[/COLOR] Rng [COLOR="Navy"]As[/COLOR] Range, Dn [COLOR="Navy"]As[/COLOR] Range, Sp [COLOR="Navy"]As[/COLOR] Variant, R [COLOR="Navy"]As[/COLOR] Variant, NoStr [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
[COLOR="Navy"]Dim[/COLOR] i, j, sRay [COLOR="Navy"]As[/COLOR] Variant, Temp1 [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String,[/COLOR] temp2 [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
NoStr = "#cat#dog#the#" '[COLOR="Green"][B] Alter/Add words not to include here !!!![/B][/COLOR]
[COLOR="Navy"]Set[/COLOR] Rng = Range(Range("A1"), Range("A" & 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
Sp = Split(Dn.Value, " ")
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] R [COLOR="Navy"]In[/COLOR] Sp
[COLOR="Navy"]If[/COLOR] Not R = vbNullString And InStr(NoStr, "#" & R & "#") = 0 [COLOR="Navy"]Then[/COLOR]
[COLOR="Navy"]If[/COLOR] Not .Exists(R) [COLOR="Navy"]Then[/COLOR]
.Add R, 1
[COLOR="Navy"]Else[/COLOR]
.Item(R) = .Item(R) + 1
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] R
[COLOR="Navy"]Next[/COLOR] Dn
sRay = Application.Transpose(Array(.Keys, .items))
[COLOR="Navy"]For[/COLOR] i = 1 To UBound(sRay, 1)
[COLOR="Navy"]For[/COLOR] j = i To UBound(sRay, 1)
[COLOR="Navy"]If[/COLOR] sRay(j, 2) > sRay(i, 2) [COLOR="Navy"]Then[/COLOR]
Temp1 = sRay(i, 1)
temp2 = sRay(i, 2)
sRay(i, 1) = sRay(j, 1)
sRay(i, 2) = sRay(j, 2)
sRay(j, 1) = Temp1
sRay(j, 2) = temp2
[COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR] j
[COLOR="Navy"]Next[/COLOR] i
Range("B1").Resize(UBound(sRay, 1), 2) = sRay
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]