Solved

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

Posted on 2013-05-18
2
303 Views
Last Modified: 2013-05-19
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.
0
Comment
Question by:Zack
2 Comments
 
LVL 81

Accepted Solution

by:
byundt earned 500 total points
ID: 39177342
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
 

Author Closing Comment

by:Zack
ID: 39179734
Thank you for the info.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question