Sub Masquer_Lignes_et_Colonnes()
Application.ScreenUpdating = False
'basée sur l'idée de Sylvanu
C = ActiveSheet.UsedRange.Columns.Count + 2
With Range(Cells(1, C), Cells(ActiveSheet.UsedRange.Rows.Count, C))
Plage = "A1:" & Cells(1, C - 2).Address(False, False)
.FormulaLocal = "=SI(NB.SI(" & Plage & ";""><"")+NB.SI(" & Plage & ";"">0"")=0;""$$$"";0)"
.Value = .Value
.SpecialCells(xlCellTypeConstants, xlTextValues).EntireRow.Hidden = True
.Clear
End With
R = ActiveSheet.UsedRange.Rows.Count + 2
With Range(Cells(R, 1), Cells(R, ActiveSheet.UsedRange.Columns.Count))
Plage = "A1:" & Cells(R - 2, 1).Address(False, False)
.FormulaLocal = "=SI(NB.SI(" & Plage & ";""><"")+NB.SI(" & Plage & ";"">0"")=0;""$$$"";0)"
.Value = .Value
.SpecialCells(xlCellTypeConstants, xlTextValues).EntireColumn.Hidden = True
.Clear
End With
End Sub