Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide empty rows on open Joshy Excel Discussion (Misc queries) 1 August 28th 09 01:52 PM
I have more than 65K rows when I open Excel 2007 [email protected] Excel Discussion (Misc queries) 2 February 22nd 09 08:16 PM
hide columns/rows/cells on open notso Excel Discussion (Misc queries) 4 September 28th 08 06:40 PM
open new blank worksheet with over 65,000 rows EBrant New Users to Excel 2 July 19th 07 04:23 PM
Why are my columns and rows reversed when I open Excel Deb Web Excel Discussion (Misc queries) 1 June 9th 05 11:06 PM


All times are GMT +1. The time now is 02:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"