# how to create a Random list of names without duplicates

#### roony

##### New Member
hi,

i've tried searching, googling but cant find anything to get rid of the duplicates in my list.

bob
bill
john
jim

i keep getting duplicates everytime i try to randomise the list.

any urls or some code or something, wld be appreciated, i need this pretty quick, thanks

### Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This was posted by SIXTHSENSE some time ago:

It randomises 8 names from a list.
First create a table of names:
Type sequence 1 - 20 in column F
Type names in column G

The macro will put random numbers in A1:A8
In B1 put this formula:
=VLOOKUP(A1,\$F\$1:\$G\$20,2,FALSE)

(ie the macro sets random number in column A and the formula looks up that number in your table)

Sub RandomNumbers() 'by SIXTHSENSE
Dim ranNum(8) As Integer
counter = 1
While counter <= 8
tmp = Int((20 * Rnd) + 1)
found = False
For j = 1 To counter
If tmp = ranNum(j) Then
found = True
Exit For
End If
Next j
If found = False Then
ranNum(counter) = tmp
counter = counter + 1
End If
Wend
For i = 1 To 8
Range("a" & i).Value = ranNum(i)
Next i
End Sub

regards
Derek

This was posted by SIXTHSENSE some time ago:

It randomises 8 names from a list.
First create a table of names:
Type sequence 1 - 20 in column F
Type names in column G

The macro will put random numbers in A1:A8
In B1 put this formula:
=VLOOKUP(A1,\$F\$1:\$G\$20,2,FALSE)

(ie the macro sets random number in column A and the formula looks up that number in your table)

Sub RandomNumbers() 'by SIXTHSENSE
Dim ranNum(8) As Integer
counter = 1
While counter <= 8
tmp = Int((20 * Rnd) + 1)
found = False
For j = 1 To counter
If tmp = ranNum(j) Then
found = True
Exit For
End If
Next j
If found = False Then
ranNum(counter) = tmp
counter = counter + 1
End If
Wend
For i = 1 To 8
Range("a" & i).Value = ranNum(i)
Next i
End Sub

regards
Derek
The formual above does not work to produce a name without a duplicate. I keep getting the duplicates..I want to know is there a way to select a name and place it in a bracket and not have it selected again.. I have tried random selection and table array and nothing works.. I can get the names to not repeat be whatever is in a1 will always be in the 1st or top bracket slot.. I want the names to ge into a random slot... is there a way to do this off of a list of names

Replies
5
Views
481
Replies
3
Views
428
Replies
6
Views
380
Replies
8
Views
443
Replies
3
Views
2K

1,217,498
Messages
6,136,993
Members
450,037
Latest member
Tao86

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back