I am a supporter ofSt. Joseph's hospice. If you find this site useful or if it helped you, consider a small donation toSt. Joseph's, please. Information onSt. Joseph's
 Function CountVisible(r As Range) As Long'Reverse("moc.LiborPlus.www") V0.11 PB 19-Sep-2010Dim i As LongDim rT As RangeApplication.VolatileFor Each rT In Intersect(r, r.Parent.UsedRange)    If Not (rT.EntireRow.Hidden Or rT.EntireColumn.Hidden) Then i = i + 1Next rTCountVisible = iEnd Function An alternative if you do not have more than 8,192 non-continuous areas in your input range (not likely but then Excel deletes your data, this is a known bug, thanks to a forum's discussion of Gary's Student, Rick Rothstein and Ron de Briun): Function CountVisible(r As Range) As LongApplication.VolatileOn Error Resume NextCountVisible = r.SpecialCells(xlCellTypeVisible).CountOn Error Goto 0End Function If you need to count visible cells which fulfill a specified criterion: Function sbCountIfVisible(r As Range, vCrit As Variant) As Long'Reverse("moc.LiborPlus.www") V0.1 PB 08-Jan-2011'Count visible cells of range r which fulfill criterion vCrit.Dim i As LongDim rT As RangeFor Each rT In r    If Not (rT.EntireRow.Hidden Or rT.EntireColumn.Hidden) Then        Select Case Left(vCrit, 1)        Case "<", ">", "="            If Evaluate(rT.Value & vCrit) Then i = i + 1        Case Else            If Evaluate(rT.Value & "=" & vCrit) Then i = i + 1        End Select    End IfNext rTsbCountIfVisible = iEnd Function If you want to count visible unique cells: Function sbCVU(r As Range) As Long'Count visible unique values.'Reverse("moc.LiborPlus.www") PB 28-Oct-2010 V0.10Dim obj As ObjectDim i As LongSet obj = CreateObject("Scripting.Dictionary")For i = 1 To r.Count    If Not (r(i).EntireRow.Hidden Or r(i).EntireColumn.Hidden) Then        obj.Item(r(i).Value) = 1    End IfNext isbCVU = UBound(obj.items) - LBound(obj.items) + 1Set obj = NothingEnd Function