Private Sub Workbook_BeforeClose(Cancel As Boolean)
'déclaration ===================================
Dim Cel As Range, Plage As Range
'MEI ===========================================
Set Plage = Range("K2")
'traitement ====================================
For Each Cel In Plage
'pour chaque cellule de plage
If Cel = "" And Cel.Offset(0, 1) = "" And Cel.Offset(0, 2) = "" Then
Range(Cel, Cel.Offset(0, 2)).Select
MsgBox "Une de ces cellules doit être remplie !", vbExclamation + vbOKOnly, "ERREUR SAISIE"
Cancel = True
Exit Sub
End If
If Cel.Offset(0, 5) = "" And Cel.Offset(0, 6) = "" And Cel.Offset(0, 7) = "" Then
Range(Cel.Offset(0, 5), Cel.Offset(0, 7)).Select
MsgBox "Une de ces 3 cellules doit être remplie !", vbExclamation + vbOKOnly, "ERREUR SAISIE"
Cancel = True
Exit Sub
End If
Next Cel
End Sub