![]() |
Open up rows
Hi,
I'm attempting to check whether a selection contains rows that are hidden.. For Each cell In Selection If cell.EntireRow.Hidden = True Then Selection.EntireRow.Hidden = False End If next cell This can take time to run if for instance the selection is of an entire column. Clearly I would only want to run through one column, rather than all those contained in selection. How can I improve on the syntax..?? Thks...Chris |
Open up rows
Chris,
If you just want to make all rows visible, it can be done with cells.entirerow.hidden=false -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Chris Gorham" wrote in message ... Hi, I'm attempting to check whether a selection contains rows that are hidden.. For Each cell In Selection If cell.EntireRow.Hidden = True Then Selection.EntireRow.Hidden = False End If next cell This can take time to run if for instance the selection is of an entire column. Clearly I would only want to run through one column, rather than all those contained in selection. How can I improve on the syntax..?? Thks...Chris |
Open up rows
One way:
Based on your current code, you should use Selection.EntireRow.Hidden = False If there are no hidden rows in the selection, this has no effect. If there are any hidden rows, all of them are made visible. In article , "Chris Gorham" wrote: Hi, I'm attempting to check whether a selection contains rows that are hidden.. For Each cell In Selection If cell.EntireRow.Hidden = True Then Selection.EntireRow.Hidden = False End If next cell This can take time to run if for instance the selection is of an entire column. Clearly I would only want to run through one column, rather than all those contained in selection. How can I improve on the syntax..?? Thks...Chris |
Open up rows
Chris,
You can use something like the following... '--------------------------- Dim N as Long Dim NewCount as Long N = Selection.Rows.Count NewCount = Selection.Columns(1).SpecialCells(xlCellTypeVisibl e).Count If N < NewCount Then MsgBox "Hidden Rows" End If '--------------------------------- Regards, Jim Cone San Francisco, CA "Chris Gorham" wrote in message ... Hi, I'm attempting to check whether a selection contains rows that are hidden.. For Each cell In Selection If cell.EntireRow.Hidden = True Then Selection.EntireRow.Hidden = False End If next cell This can take time to run if for instance the selection is of an entire column. Clearly I would only want to run through one column, rather than all those contained in selection. How can I improve on the syntax..?? Thks...Chris |
All times are GMT +1. The time now is 07:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com