suppose range is only column range A1 to A25
quote
5 of them match 5 other numbers (within the same range)
unquote
explain this with example so that I can attept.

for filling the above range with random nos. this is the macro

Sub test()
    Dim r As Range
    Set r = Range("A1:a25")
    r.Clear
    Range("A1").Formula = "=randbetween(1,20)"
    Range("A1").Copy r
End Sub