Fermer un msgbox sans exécuter une autre action

Bonjour

J'ai un msgbox avec juste un bouton "OK". J'aimerais juste fermer le msgbox en cliquant sur "OK" sans exécuter aucune autre action. Merci de regarder mon code en dessous. Mon problème est au niveau du msgbox = "n'existe pas !". Après avoir cliquez sur "OK" je ne voudrais pas que le code en dessous s'exécute. Merci de votre aide !

If ComboBox1 <> "" Then

Set cel = Feuil2.Range("B2:B" & Feuil2.Range("B" & Rows.Count).End(xlUp).Row).Find(ComboBox1, , , xlWhole)

If Not cel Is Nothing Then lig = cel.Row Else: MsgBox "n'existe pas!"

UserForm2.Label10 = Feuil2.Cells(lig, 1)

UserForm2.Label11 = Feuil2.Cells(lig, 2)

UserForm2.Label12 = Feuil2.Cells(lig, 3)

UserForm2.Label13 = Feuil2.Cells(lig, 4)

UserForm2.Label14 = Feuil2.Cells(lig, 5)

UserForm2.Label15 = Feuil2.Cells(lig, 6)

UserForm2.Label16 = Feuil2.Cells(lig, 7)

UserForm2.ComboBox1.ListIndex = -1

End If

Bonjour

A tester

  If ComboBox1 <> "" Then
    Set cel = Feuil2.Range("B2:B" & Feuil2.Range("B" & Rows.Count).End(xlUp).Row).Find(ComboBox1, , , xlWhole)
    If Not cel Is Nothing Then
      lig = cel.Row
      UserForm2.Label10 = Feuil2.Cells(lig, 1)
      UserForm2.Label11 = Feuil2.Cells(lig, 2)
      UserForm2.Label12 = Feuil2.Cells(lig, 3)
      UserForm2.Label13 = Feuil2.Cells(lig, 4)
      UserForm2.Label14 = Feuil2.Cells(lig, 5)
      UserForm2.Label15 = Feuil2.Cells(lig, 6)
      UserForm2.Label16 = Feuil2.Cells(lig, 7)
      UserForm2.ComboBox1.ListIndex = -1
    Else
      MsgBox "n'existe pas!"
    End If
  End If

Merci beaucoup Banzai64, ça marche !

Rechercher des sujets similaires à "fermer msgbox executer action"