If I understand your question correctly, here is an alternative way to approach your problem that will give you some code that runs faster and is a pretty clean to manage:
Option Explicit
Sub CountHiddenRows()
Dim wks As Worksheet
Set wks = ThisWorkbook.Sheets("ALL")
With wks
Dim lngLastRow As Long
lngLastRow = .Range("A" & .Rows.Count).End(xlUp).Row
.Range("A3:A" * lngLastRow).EntireRow.Hidden = True
Dim rngConsider As Range
Dim lngHiddenRows As Long, lngRows As Long, lngVisibleRows As Long
Set rngConsider = .Range("A1:A" & lngLastRow)
lngRows = rngConsider.Rows.Count
lngVisibleRows = rngConsider.SpecialCells(xlCellTypeVisible).Rows.Count
lngHiddenRows = lngRows - lngVisibleRows
MsgBox "There are " & lngHiddenRows & " hidden rows."
End With
End Sub