Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Cell selection with hidden rows

I have a spreadsheet that has hidden rows (hidden by using AutoFilter).

I wish to write a macro in which I need to select a cell on the visible row
below the current cell. For example if the currently selected cell is on
row 2 and rows 3-6 are hidden I wish to select the cell on row 7.

If the rows were not hidden I could use
ActiveCell.Offset(1,0).Range("A1").Select

How can I achieve what I want with an unknown variable number of hidden rows
between two visible rows?




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Cell selection with hidden rows

Use RowHeight property of range object as follows:

****************code starts*************

Sub GoToNextVisibleCellDown()
Dim cell As Range
Set cell = ActiveCell
Do
Set cell = cell.Offset(1, 0)
Loop While cell.RowHeight = 0
cell.Select
Set cell = Nothing
End Sub

****************code ends*************



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Cell selection with hidden rows

DomThePom wrote:
Use RowHeight property of range object as follows:

****************code starts*************

Sub GoToNextVisibleCellDown()
Dim cell As Range
Set cell = ActiveCell
Do
Set cell = cell.Offset(1, 0)
Loop While cell.RowHeight = 0
cell.Select
Set cell = Nothing
End Sub

****************code ends*************



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from
http://www.ExcelForum.com/


Excellent, thank you. I'm a bit of a novice as you might have guessed!


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
opening a group but keep hidden rows hidden MWL Excel Discussion (Misc queries) 0 February 17th 09 03:16 PM
Hidden rows columns won't stay hidden christie Excel Worksheet Functions 0 September 30th 08 05:44 PM
Excel sheet: selection of cell or rows not visible. Hisoul Excel Worksheet Functions 2 May 16th 07 09:06 PM
Formula or Code to keep Hidden Rows Hidden Carol Excel Worksheet Functions 6 May 1st 07 11:45 PM
I need my Hidden Rows to stay hidden when I print the sheet. Rosaliewoo Excel Discussion (Misc queries) 2 July 20th 06 07:51 PM


All times are GMT +1. The time now is 09:31 AM.

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

About Us

"It's about Microsoft Excel"