Sub Test()
Dim Rng As Range, RngVis As Range, Z As Range, NbLVis As Long, NbCVis As Integer
Set Rng = ActiveSheet.UsedRange
Set RngVis = Rng.SpecialCells(Type:=xlCellTypeVisible)
For Each Z In Intersect(RngVis.Areas(1).Columns(1).EntireColumn, RngVis).Areas
NbLVis = NbLVis + Z.Rows.Count: Next Z
For Each Z In Intersect(RngVis.Areas(1).Rows(1).EntireRow, RngVis).Areas
NbCVis = NbCVis + Z.Columns.Count: Next Z
MsgBox Rng.Rows.Count - NbLVis & " ligne(s) masquée(s), " _
& Rng.Columns.Count - NbCVis & " colonne(s) masquée(s).", _
vbInformation, "Test"
End Sub