XL 2019 creation d'une boite de dialogue dans ma macro

valouf

XLDnaute Junior
Bonjour j'aimerais obtenir de l'aide d'apres ma macro decompte qu'une boite de dialogue s'ouvre me bloquant la macro afin que je puisse envoyer ensuite un message vocal merci d'avance
 

Pièces jointes

  • tgv.xlsm
    19.5 KB · Affichages: 4

Jacky67

XLDnaute Barbatruc
Bonjour j'aimerais obtenir de l'aide d'apres ma macro decompte qu'une boite de dialogue s'ouvre me bloquant la macro afin que je puisse envoyer ensuite un message vocal merci d'avance
Bonjour,
Une proposition avec ce code en PJ
VB:
Sub DecompteMN()
    With Sheets("travail")
        If IsNumeric(.[B9]) Then
            If .[B9] > 0 Then
                .[E4] = .[B9]
                Call arret("départ à" & Format(Time, "hh""heure"" mm"))
                Do While .[E4] > 0
                    Application.Wait Now + TimeValue("0:0:1")
                    .[E4] = .[E4] - 1
                    If .[E4] = 400 Then Call arret("Vous êtes de passage à nantes")
                Loop
            End If
        End If
        Call arret("Vous êtes arrivé")
    End With
End Sub
Sub arret(vocal)
    Application.Speech.Speak vocal, 1
End Sub
 

Pièces jointes

  • tgv.xlsm
    25.7 KB · Affichages: 7

valouf

XLDnaute Junior
Bonjour,
Une proposition avec ce code en PJ
VB:
Sub DecompteMN()
    With Sheets("travail")
        If IsNumeric(.[B9]) Then
            If .[B9] > 0 Then
                .[E4] = .[B9]
                Call arret("départ à" & Format(Time, "hh""heure"" mm"))
                Do While .[E4] > 0
                    Application.Wait Now + TimeValue("0:0:1")
                    .[E4] = .[E4] - 1
                    If .[E4] = 400 Then Call arret("Vous êtes de passage à nantes")
                Loop
            End If
        End If
        Call arret("Vous êtes arrivé")
    End With
End Sub
Sub arret(vocal)
    Application.Speech.Speak vocal, 1
End Sub
Génial jacky je vous remercie bcp mais comme je me bat encore avec visual basic et si je veux mettre un autre passage à toulouse je recopie la ligne if de nantes ? MERCI
 

Discussions similaires

Statistiques des forums

Discussions
312 216
Messages
2 086 351
Membres
103 195
dernier inscrit
martel.jg