Sub RandomizeOrder()
Dim v, temp
Dim i As Long, el As Long
Randomize
v = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
For i = 1 To UBound(v, 1)
el = Int(Rnd * UBound(v, 1)) + 1
temp = v(el, 1)
v(el, 1) = v(i, 1)
v(i, 1) = temp
Next
Range("A1").Resize(UBound(v, 1)) = v
End Sub
Hi Stephen
Give this a try:
Code:Sub RandomizeOrder() Dim v, temp Dim i As Long, el As Long Randomize v = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row) For i = 1 To UBound(v, 1) el = Int(Rnd * UBound(v, 1)) + 1 temp = v(el, 1) v(el, 1) = v(i, 1) v(i, 1) = temp Next Range("A1").Resize(UBound(v, 1)) = v End Sub
Sub RandomizeOrder()
[b1].Resize([a65536].End(3).Row) = "=rand()"
[a:b].Sort [b1]
[b:b] = ""
End Sub