Sub Test()
y = 7
For i = 1 To Application.CountA(Columns(1))
For j = 1 To Application.CountA(Columns(2))
For k = 1 To Application.CountA(Columns(3))
For l = 1 To Application.CountA(Columns(4))
For m = 1 To Application.CountA(Columns(5))
a = Cells(i, 1)
b = Cells(j, 2)
c = Cells(k, 3)
d = Cells(l, 4)
e = Cells(m, 5)
Arr = Array(a, b, c, d, e)
If Not (IsError(Application.Match(a, Array(b, c, d, e), 0))) Then GoTo bb
If Not (IsError(Application.Match(b, Array(a, c, d, e), 0))) Then GoTo bb
If Not (IsError(Application.Match(c, Array(a, b, d, e), 0))) Then GoTo bb
If Not (IsError(Application.Match(d, Array(a, b, c, e), 0))) Then GoTo bb
If Not (IsError(Application.Match(e, Array(a, b, c, d), 0))) Then GoTo bb
If Not (a = Application.WorksheetFunction.Small(Arr, 1)) Then GoTo bb
If Not (b = Application.WorksheetFunction.Small(Arr, 2)) Then GoTo bb
If Not (c = Application.WorksheetFunction.Small(Arr, 3)) Then GoTo bb
If Not (d = Application.WorksheetFunction.Small(Arr, 4)) Then GoTo bb
If Not (e = Application.WorksheetFunction.Small(Arr, 5)) Then GoTo bb
If x = 65000 Then
x = 0
y = y + 1
End If
x = x + 1
Cells(x, y) = Join(Array(a, b, c, d, e), ",")
bb:
Next
Next
Next
Next
Next
End Sub