Option Explicit
Sub NK_alea()
Dim a As Integer, i As Integer
Const n As Integer = 13 'nb. aléatoire max
Const k As Integer = 6 'fréquence max d'apparition
Dim tt(n) As Long
Randomize ' Initialise le générateur de nombres aléatoires
Do
a = Int((n * Rnd) + 1)
tt(a) = tt(a) + 1
If tt(a) <= k Then
i = i + 1
Worksheets("Feuil1").Range("A" & i) = a
End If
Loop While i < n * k
End Sub
non ma colonne contient exactement 78 cases et je veux qu'il y ait 6 fois chaque numero merci d'avance