Sub Masquer_PDF()
Dim feuille, f As Worksheet, P As Range, a(), i&, r As Range
Application.ScreenUpdating = False
On Error Resume Next 'si aucune SpecialCell
Set feuille = Sheets(Array("plan", "Mesure pour client"))
For Each f In feuille
f.PageSetup.PrintArea = "A1:AJI189"
f.Rows.Hidden = False
f.Columns.Hidden = False
Set P = f.UsedRange
'---lignes---
ReDim a(1 To P.Rows.Count, 1 To 1) 'matrice, plus rapide
For i = 1 To UBound(a)
Set r = P.Rows(i)
a(i, 1) = Application.CountIf(r, "><") + Application.CountIf(r, ">0") + Application.CountIf(r, "<0")
If a(i, 1) = 0 Then a(i, 1) = "#N/A"
Next i
With P.Columns(P.Columns.Count + 1) 'colonne auxiliaire suivant la dernière colonne
.Value = a 'restitution
.SpecialCells(xlCellTypeConstants, 16).EntireRow.Hidden = True 'masque en bloc
.ClearContents 'efface la colonne auxiliaire
End With
f.Rows("1:3").Hidden = False
f.Rows("184:" & f.Rows.Count).Hidden = False
'---colonnes---
ReDim a(1 To 1, 1 To P.Columns.Count) 'matrice, plus rapide
For i = 1 To UBound(a, 2)
Set r = P.Columns(i)
a(1, i) = Application.CountIf(r, "><") + Application.CountIf(r, ">0") + Application.CountIf(r, "<0")
If a(1, i) = 0 Then a(1, i) = "#N/A"
Next i
With P.Rows(P.Rows.Count + 1) 'ligne auxiliaire suivant la dernière ligne
.Value = a 'restitution
.SpecialCells(xlCellTypeConstants, 16).EntireColumn.Hidden = True 'masque en bloc
.ClearContents 'efface la ligne auxiliaire
End With
Next f
'---PDF---
feuille.Select
ActiveSheet.ExportAsFixedFormat xlTypePDF, ThisWorkbook.Path & "\Fichier PDF.pdf", OpenAfterPublish:=False
feuille(1).Select
End Sub