Bonsour®
Bonjour à tous,
Pourrais-je avoir un son à chaque N° de sortie du loto dans ce fichier !
Merci à l'avance et bonne soirée !
Application.Speech.Speak "numéro : " & Num
dans la proc Tirage :
Sub Tirage()
Dim Num As Long, Coul As Byte
On Error Resume Next
If MesNuméros.Count = 0 Then
On Error GoTo 0
Set MesNuméros = CreateObject("Scripting.Dictionary")
Mini = [B1]
Maxi = [B2]
End If
If MesNuméros.Count = Maxi - Mini + 1 Then MsgBox "Terminé": Exit Sub
Do While X = 0
Randomize (Timer)
Num = Int(((Maxi - Mini + 1) * Rnd) + Mini)
Coul = Int(((4 - Mini + 1) * Rnd) + Mini)
With ActiveSheet.Shapes.Range(Array("Rectangle 1")).Select
If Coul = 1 Then Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 0): [E11].Font.ColorIndex = 6 'Jaune
If Coul = 2 Then Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0): [E11].Font.ColorIndex = 3 'Rouge
If Coul = 3 Then Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 176, 240): [E11].Font.ColorIndex = 5 'Bleu
If Coul = 4 Then Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 176, 80): [E11].Font.ColorIndex = 4 'Vert
End With
Range("E11").Select
If Not MesNuméros.Exists(Num) Then
X = 1
MesNuméros.Add Num, Num
[E11] = Num
Application.Speech.Speak "Numéro :" & Num
[G65000].End(xlUp)(2) = Num
Call controle
End If
Loop
End Sub