A adapter selon souhaits spécifiques :
Sub ToPDF()
Dim T(15), Lgn, Fich, n%, i%
With ActiveCell
If .Column = 1 And .Row > 1 Then
n = .Row
If MsgBox("Souhaitez-vous exporter la fiche n° " & .Offset(, 1) & " ?", _
vbYesNo, "Confirmation") = vbNo Then Exit Sub
Else
Exit Sub
End If
End With
Lgn = Array(2, 3, 4, 5, 6, 7, 10, 16, 18, 12, 15, 13, 21, 8, 20, 11)
Fich = Split("B10 B13 B14 B15 B16 B17 A21 B23 B24 B25 B26 B27 A31 B33 B34 B35")
With ActiveSheet
For i = 0 To 15
T(i) = .Cells(n, Lgn(i))
Next i
End With
With Worksheets("Fiche")
For i = 0 To 15
.Range(Fich(i)) = T(i)
Next i
Application.ScreenUpdating = False
.Visible = xlSheetVisible
.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path & "\IT" & T(0) & ".pdf", _
openafterpublish:=True
For i = 0 To 15
.Range(Fich(i)).MergeArea.ClearContents
Next i
.Visible = xlSheetHidden
End With
End Sub
Celle-ci, après sélection cellule en A (marquée...), remplit la fiche, la démasque et l'exporte en pdf (enregistré dans le même dossier) et l'efface et la remasque. Le pdf créé s'affiche.
Cordialement.