View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Generating a random 17-character alphanumeric string

This macro will fill cells A1 thru A13:

Sub numberit()

'gsnuxx

i = Array(48, 49, 50, 51, 52, 53, 54, 55, 56, 57, _
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, _
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, _
97, 98, 99, 100, 101, 102, 103, 104, 105, 106, _
107, 108, 109, 110, 111, 112, 113, 114, 115, 116, _
117, 118, 119, 120, 121, 122)
For k = 1 To 13
v = ""
For j = 1 To 17
n = Evaluate("=randbetween(0,61)")
ch = Chr(i(n))
v = v & ch
Next
Range("A" & k).Value = v
Next
End Sub

Just change the line:

For k = 1 To 13 to suit your needs
--
Gary''s Student - gsnu200769


"Dan" wrote:

EXCEL 2007
I would like to generate a column of random 17-character alphanumeric
strings into cells A1:A100000. I'd also like to continue into column B: eg;
B1:B100000 so that I have 200000 random VINs.
Can anyone help? I can think of some brute-force methods but I'm looking for
an elegant solution. I think it can be done in one column with EXCEL 2007.
Thanks for any help.
Dan