Re : Comment sommer sous VBA
Re
Tu peux imbriquer tes deux conditions en reprenant le code de thebenoit59.
Private Sub Workbook_BeforeClose(Cancel As Boolean)
With Sheets(1)
For i = 1 To .[c65000].End(xlUp).Row
If .Cells(i, 3).Value = "PERM" Then
If .Cells(i, "i") = 0 Then MsgBox "Honoraire à 0 pour le candidat, ligne " & i: Cancel = True: Exit Sub
If .Cells(i, "x") = "" Then MsgBox "Mentionner Facturé/Potentiel pour le candidat, ligne " & i: Cancel = True: Exit Sub
If WorksheetFunction.Sum(.Range(.Cells(i, "y"), .Cells(i, "aj"))) = 0 Then MsgBox "Pas de donnée sur le détail par mois pour le candidat, ligne " & i: Cancel = True: Exit Sub
ElseIf .Cells(j, 3).Value = "TT" Then
If .Cells(j, "p") = 0 Then MsgBox "Honoraire à 0 pour le candidat, ligne " & i: Cancel = True: Exit Sub
If .Cells(j, "q") = 0 Then MsgBox "Honoraire à 0 pour le candidat, ligne " & i: Cancel = True: Exit Sub
If .Cells(j, "x") = "" Then MsgBox "Mentionner Facturé/Potentiel pour le candidat, ligne " & i: Cancel = True: Exit Sub
If WorksheetFunction.Sum(.Range(.Cells(j, "y"), .Cells(j, "aj"))) = 0 Then MsgBox "Pas de donnée sur le détail par mois pour le candidat, ligne " & i: Cancel = True: Exit Sub
End If
Next i
End With
End Sub
Question subsidiaire , je ne trouve pas comment faire une réponse avec le texte encadré