Sub PDF()
'se lance par les touches Ctrl+Z
Dim a, b, F As Object, S As Object, w As Worksheet, i As Variant, ncol%, tablo, j%
a = Array("1st PAGE", "CMD_SOLUTIONS", "HARDWARE_SOFTWARE", "LAST PAGE")
b = Array(9, 7, 8, 9) 'nombre de colonnes à imprimer
Set F = ActiveSheet
Set S = ActiveWindow.SelectedSheets 'sélection groupée
F.Select 'dégroupe
If IsError(Application.Match(F.Name, a, 0)) Then MsgBox "Sélectionnez en premier l'une des 4 feuilles...": Exit Sub
Application.ScreenUpdating = False
For Each w In S
i = Application.Match(w.Name, a, 0)
If IsNumeric(i) Then
w.Select False 'regroupe
ncol = b(i - 1)
tablo = w.UsedRange.Resize(, ncol) 'matrice, plus rapide
For i = UBound(tablo) To 1 Step -1
For j = 1 To ncol
If CStr(tablo(i, j)) <> "" Then GoTo 1
Next j, i
1 If i Then w.PageSetup.PrintArea = w.UsedRange.Resize(i, ncol).Address 'zone d'impression
End If
Next w
ActiveSheet.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path & "\Mon PDF.pdf" 'nom à adapter
F.Select 'dégroupe
End Sub