J ai 3 codes successifs qui s'enchainent et j aimerais en faire qu' un seul pour qu'il n y ait qu' une Msgbox
j ai essayé de les regrouper en supprimant les deux premières msgbox mais sa ne fonctionne pas

Merci d'avance

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Sub Vérifications_1()
 
    Const AG = "MDL"
    Const TYP = "CL"
 
    With Feuil1.Cells(1).CurrentRegion
 
        For R& = 1 To .Rows.Count
 
            If .Cells(R, 9).Text = AG And .Cells(R, 5).Text = TYP And .Cells(R, 3).Value < Date And Cells(R, 7).Value = 1 Then
 
                T$ = T$ & vbLf & .Cells(R, 5).Text & vbTab & vbTab & .Cells(R, 4).Text & vbTab & vbTab & .Cells(R, 1).Text & vbTab
 
            End If
 
        Next
 
    End With
 
    If T <> "" Then
 
        MsgBox "CL en date dépassée !" & Chr(10) & "Veuillez les régulariser et Editer un nouvel état de parc !" & Chr(10) & Chr(10) & "Typ Doc" & vbTab & vbTab & "No de Doc" & vbTab & "Immat" & T, vbExclamation, "   EN DATE DEPASSEE " & AG
 
    Else
 
        MsgBox "Pas de CL en date dépassée !"
        Call Vérifications_2
    End If
 
End Sub
Code 2
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Sub Vérifications_2()
 
    Const AG = "MDL"
    Const TYP = "CP"
    With Feuil1.Cells(1).CurrentRegion
 
        For R& = 1 To .Rows.Count
 
            If .Cells(R, 9).Text = AG And .Cells(R, 5).Text = TYP And .Cells(R, 3).Value < Date And Cells(R, 7).Value = 1 Then
 
                T$ = T$ & vbLf & .Cells(R, 5).Text & vbTab & vbTab & .Cells(R, 4).Text & vbTab & vbTab & .Cells(R, 1).Text & vbTab
 
            End If
 
        Next
 
    End With
 
    If T <> "" Then
 
        MsgBox "CP en date dépassée !" & Chr(10) & "Veuillez les régulariser et Editer un nouvel état de parc !" & Chr(10) & Chr(10) & "Typ Doc" & vbTab & vbTab & "No de Doc" & vbTab & "Immat" & T, vbExclamation, "   EN DATE DEPASSEE " & AG
 
    Else
 
        MsgBox "Pas de CP en date dépassée !"
        Call Vérifications_3
    End If
 
End Sub
Code 3
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Sub Vérifications_3()
 
    Const AG = "MDL"
    Const TYP = "MV"
    With Feuil1.Cells(1).CurrentRegion
 
        For R& = 1 To .Rows.Count
 
            If .Cells(R, 9).Text = AG And .Cells(R, 5).Text = TYP And .Cells(R, 3).Value < Date And Cells(R, 8).Value = 1 Then
 
                T$ = T$ & vbLf & .Cells(R, 5).Text & vbTab & vbTab & .Cells(R, 4).Text & vbTab & vbTab & .Cells(R, 1).Text & vbTab
 
            End If
 
        Next
 
    End With
 
    If T <> "" Then
 
        MsgBox "Mouvements en date dépassée !" & Chr(10) & "Veuillez les régulariser et Editer un nouvel état de parc !" & Chr(10) & Chr(10) & "Typ Doc" & vbTab & vbTab & "No de Doc" & vbTab & "Immat" & T, vbExclamation, "   EN DATE DEPASSEE " & AG
 
    Else
 
        MsgBox "Pas de Mouvements en date dépassée !"
 
    End If
 
End Sub