Sub Impression()
DL = Range("A65500").End(xlUp).Row
NbImpression = Application.CountIf(Range("J1:J" & DL), "Depot"): Nimp = 0
For L = 2 To DL
If Cells(L, "J") = "Depot" Then
Range("A" & L & ":J" & L).Interior.Color = vbGreen ' Ligne considérée en vert
Titre = "Nombre potentiel d'impression restant : " & NbImpression - Nimp
reponse = MsgBox("Doit on imprimer ce client ?", vbYesNoCancel + vbExclamation + vbDefaultButton2, Titre)
Range("A" & L & ":J" & L).Interior.Color = vbWhite ' Ligne considérée en blanc
If reponse = vbCancel Then Exit Sub ' Annulation
If reponse = vbYes Then ' Impression demandée
With Sheets("Dépôt")
For Nitem = 1 To 8 ' Transfert des données
' N° ligne où ranger y = 2x + 3
.Cells(2 * Nitem + 3, "D") = Cells(L, Nitem)
Next Nitem
Application.ScreenUpdating = False
.PrintOut ' Impression
Application.ScreenUpdating = True
End With
End If
Nimp = Nimp + 1 ' Nombre de potentielles impression restantes
End If
Next L
End Sub