Sub Bouton1_Cliquer()
Dim Cel As Range, WS1 As Worksheet, WS2 As Worksheet, DerLig As Integer, i As Integer
Set WS1 = Worksheets("Formations PSST")
Set WS2 = Worksheets("Base habilitation à la cond")
DerLig = WS1.Range("A" & Rows.Count).End(xlUp).Row
For i = 4 To DerLig
' si le nom est imprimable et non imprimé
If WS1.Range("CF" & DerLig) = 3 And WS1.Range("CG" & DerLig) <> "I" Then
WS1.Range("CG" & DerLig) = "I" ' ecriture I en col CG
WS2.Range("o3").Value = WS1.Cells(i, 1).Value
WS2.PageSetup.PrintArea = "b2:o35"
'WS2.PrintOut
WS2.PrintPreview
End If
Next
MsgBox "Les fichiers pdf ont été édités avec succès dans le dossier suivant : " & ThisWorkbook.Path
End Sub