Sub textx()
Dim Serie
Serie = getSerie(240000, 6, False) 'mettre true pour desordre
Cells(1, 1).Resize(240000, 1).Value = Serie
End Sub
Function getSerie(nb&, maxChiffre&, Optional desordre As Boolean = False)
Dim i&, c&, x&, z&, q&, valoche&
ReDim tbl(1 To nb, 1 To 1)
x = Val(Mid("111111111111111", 1, Abs(maxChiffre&)))
z = Val(Mid("999999999999999", 1, Abs(maxChiffre&)))
q = Round((z - x) / nb, 0): q = IIf(q < 1, 1, q)
x = x + Int(Rnd * Abs(q))
For i = 1 To nb - 1
x = x + 1 + (Abs(Rnd * (q - 1)))
If x Mod 10 = 0 Then x = x + 1 'remplace les sortants mod 10
If x Mod 100 = 0 Then x = x + 1 'remplace les sortants mod 100
tbl(i, 1) = x
Next
If desordre Then
For i = 1 To nb / 2
x = Round(1 + (Rnd * nb - 1))
valoche = tbl(x, 1): tbl(x, 1) = tbl(i, 1): tbl(i, 1) = valoche
Next
End If
getSerie = tbl
End Function