Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = False: Flag = 0
DL = Cells(Cells.Rows.Count, "A").End(xlUp).Row
For L = 10 To DL
If Cells(L, "A") = "c" And (Cells(L, "AB") & Cells(L, "AC") = "" Or Cells(L, "AD") & Cells(L, "AE") = "") Then
Flag = 1
ElseIf Cells(L, "A") = "a" And (Cells(L, "X") & Cells(L, "Y") = "" Or Cells(L, "AD") & Cells(L, "AE") = "") Then
Flag = 1
End If
Next L
If Flag = 1 Then
Cancel = True
MsgBox "Veuillez remplir les cellules vides"
End If
End Sub