An Excel macro (GetPerms) I wrote to generate a series of unique 13 character alphanumeric codes follows if it is of any use.
Code:
Dim seq As String * 36
Sub GetPerms()
Dim i As Integer, j As Integer, k As Integer
Dim code As String, num() As String
Dim count As Integer, CurrentRow As Integer
Dim unique As Boolean
Randomize
seq = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
ActiveSheet.Columns(1).Clear
CurrentRow = 1
Do Until count > 0 And count <= 1000
count = Val(InputBox("How many results do you want? (1 - 1000):", "Astral", 1000))
If count = 0 Then Exit Sub
Loop
ReDim num(count)
For i = 1 To count
Do While unique = False
unique = True
code = getnum
For k = 1 To count
If num(k) = "" Then Exit For
If num(k) = code Then
unique = False
Exit For
End If
Next k
Loop
num(i) = code
unique = False
Next i
For j = 1 To count
Cells(CurrentRow, 1) = num(j)
CurrentRow = CurrentRow + 1
Next j
End Sub
Function getnum() As String ' build sequence of numbers
Dim j As Integer
For j = 1 To 13
newnum = newnum + Mid(seq, (Int(Rnd * 36) + 1), 1)
Next
getnum = newnum
End Function
Also available as an Excel workbook at: http://homepage.ntlworld.com/astral....temp/codes.xls