Hello
in "feuil1" I have btn Draw when click in it I want to display the result in the feuil2 but there is an error in : "Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)"
******
Sub tirage()
Dim Tirag As Object
Dim Nbr As Long
Set Tirag = CreateObject("Scripting.Dictionary")
Sheets("Feuil2").Range("E3:E10").ClearContents
If Application.CountA(Sheets("feuil2").Range("A2:C2")) <> 3 Or [A2] > ([C2] - [B2] + 1) Then Exit Sub
While Tirag.Count < [A2]
Randomize Timer
Nbr = Int(([C2] - [B2] + 1) * Rnd + [B2])
Tirag(Nbr) = Nbr
Wend
Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)
End Sub
******
in "feuil1" I have btn Draw when click in it I want to display the result in the feuil2 but there is an error in : "Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)"
******
Sub tirage()
Dim Tirag As Object
Dim Nbr As Long
Set Tirag = CreateObject("Scripting.Dictionary")
Sheets("Feuil2").Range("E3:E10").ClearContents
If Application.CountA(Sheets("feuil2").Range("A2:C2")) <> 3 Or [A2] > ([C2] - [B2] + 1) Then Exit Sub
While Tirag.Count < [A2]
Randomize Timer
Nbr = Int(([C2] - [B2] + 1) * Rnd + [B2])
Tirag(Nbr) = Nbr
Wend
Range("E3").Resize(Tirag.Count) = Application.Transpose(Tirag.Items)
End Sub
******