
Option Explicit
Sub abc()
Dim i, j, t, a, d
Set d = CreateObject("scripting.dictionary")
For i = 1 To 100
d(i) = 0
Next
a = Range("b1:f" & [b1].End(xlDown).Row).Value
For i = 1 To UBound(a)
For j = 1 To UBound(a, 2)
d(a(i, j)) = d(a(i, j)) + 1
Next
Next
a = Application.Transpose(Array(d.keys, d.items))
For i = 1 To UBound(a) - 1
For j = i + 1 To UBound(a)
If a(i, 2) > a(j, 2) Then
t = a(i, 1): a(i, 1) = a(j, 1): a(j, 1) = t
t = a(i, 2): a(i, 2) = a(j, 2): a(j, 2) = t
End If
Next
Next
[h2].Resize(UBound(a), 2) = a
End Sub