Do not use redundant code.
The simpler the code the easier to adapt.
But: never use code you do not fully understand.

Create unique random numbers:
Sub M_snb()
    [A1:A1000].Name = "snb"
    [snb] = "=rand()"
    [snb] = [index(rank(snb,snb),)]
End Sub