How To Find if Excel Selection has any Hidden Rows/Columns

Heyas,

Is their a way in VBA to determine if an excel cell selection has any missing rows or colums in the selection?

Any help would be much appeciated.

Thank you.
ZackGeneral IT Goto GuyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
byundtConnect With a Mentor Commented:
If you don't have more than 8192 non-contiguous areas (a limit removed in Excel 2010 and later) you could use SpecialCells to return the visible cells:
NumberHiddenRows = Selection.Rows.Count - Selection.SpecialCells(xlCellTypeVisible).Rows.Count

Open in new window


If you have Excel 2007 and earlier and might have more than 8192 non-contiguous areas in your selection, then you need to loop through the selection 16000 cells at a time.
0
 
ZackGeneral IT Goto GuyAuthor Commented:
Thank you for the info.
0
All Courses

From novice to tech pro — start learning today.