Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.
Option Explicit
Function CountHiddenLines(rng As Range, Optional bHidden = True) As Long
'bHidden = TRUE counts hidden lines, otherwise counts non-hidden lines
Dim r As Range
Dim l As Long
Application.Volatile 'to capture row hiding not associated with filters
'filters are handled via timestamp on sheet, affecting a worksheet_calculate to update the function results
For Each r In rng.Worksheet.UsedRange.EntireRow
If r.EntireRow.Hidden = bHidden Then
l = l + 1
End If
Next r
CountHiddenLines = l
End Function
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Excel In-Cell Dropdown is very wide | 5 | 39 | |
Standard Deviation Excel | 13 | 27 | |
VBA Works in Excel 2010 Not 2016 Help! | 5 | 17 | |
Excel Formula to check both condition's and return values | 2 | 26 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
8 Experts available now in Live!