Solved

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

Posted on 2013-05-18
2
269 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 80

Accepted Solution

by:
byundt earned 500 total points
Comment Utility
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
Comment Utility
Thank you for the info.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now