Numeri casuali univoci che utilizzano VBA

Sto cercando di creare una serie di numeri casuali unici (non duplicabili) all’interno di un intervallo definito dall’utente. Sono riuscito a creare i numeri casuali, ma sto ottenendo valori duplicati. Come posso assicurarmi che i numeri casuali non saranno mai un duplicato?

Sub GenerateCodesUser() Application.ScreenUpdating = False Worksheets("Users").Activate Dim MINNUMBER As Long Dim MAXNUMBER As Long MINNUMBER = 1000 MAXNUMBER = 9999999 Dim Row As Integer Dim Number As Long Dim high As Double Dim Low As Double Dim i As Integer If (CustomCodes.CardNumberMin.Value = "") Then MsgBox ("Fill Card Number Field!") Exit Sub ElseIf (CustomCodes.CardNumberMin.Value  MAXNUMBER) Then MsgBox ("Card Number Value must be equal or higher then " & MAXNUMBER) Exit Sub End If Low = CustomCodes.CardNumberMin.Value high = CustomCodes.CardNumberMax.Value '<<< CHANGE AS DESIRED If (Low < 1000) Then 'break End If For i = 1 To Cells(1, 1).End(xlToRight).Column If InStr(Cells(1, i), "CardNumber") Then Row = 2 While Cells(Row, 1)  0 Do Number = ((high - Low + 1) * Rnd() + Low) Loop Until Number > Low Cells(Row, i) = Number Row = Row + 1 Wend End If Next Application.ScreenUpdating = True End Sub