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?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.