Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Move cursor down, skipping hidden rows

How can I program the cursor to do what happens when I press the Down
Arrow key, with regard to ignoring hidden rows?

If I use

[VBA] ActiveCell.Offset(1, 0).Select

....the cursor moves down to the next numerical row, which may be a
hidden row.

If I use

[VBA] SendKeys "{DOWN}"

....it behaves like CTRL+SHIFT+Down Arrow, selecting all the contiguous
non-blank cells below the active cell. That's not as advertised,
right?? (I have to remember not to execute this statement while in the
VBA editor, because from there it just moves the VBA editor's cursor.)
This is in Excel 2000.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Move cursor down, skipping hidden rows

Try this

Dim rng As Range
Set rng = Range(Cells(ActiveCell.Row + 1, 1), Cells(Rows.Count, 1))
rng.SpecialCells(xlCellTypeVisible).Cells(1).Selec t


--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ups.com...
How can I program the cursor to do what happens when I press the Down
Arrow key, with regard to ignoring hidden rows?

If I use

[VBA] ActiveCell.Offset(1, 0).Select

...the cursor moves down to the next numerical row, which may be a
hidden row.

If I use

[VBA] SendKeys "{DOWN}"

...it behaves like CTRL+SHIFT+Down Arrow, selecting all the contiguous
non-blank cells below the active cell. That's not as advertised,
right?? (I have to remember not to execute this statement while in the
VBA editor, because from there it just moves the VBA editor's cursor.)
This is in Excel 2000.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Move cursor down, skipping hidden rows

Oops
My example will only work in Col A

Dim rng As Range
Set rng = Range(Cells(ActiveCell.Row + 1, ActiveCell.Column), Cells(Rows.Count, ActiveCell.Column))
rng.SpecialCells(xlCellTypeVisible).Cells(1).Selec t


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Try this

Dim rng As Range
Set rng = Range(Cells(ActiveCell.Row + 1, 1), Cells(Rows.Count, 1))
rng.SpecialCells(xlCellTypeVisible).Cells(1).Selec t


--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ups.com...
How can I program the cursor to do what happens when I press the Down
Arrow key, with regard to ignoring hidden rows?

If I use

[VBA] ActiveCell.Offset(1, 0).Select

...the cursor moves down to the next numerical row, which may be a
hidden row.

If I use

[VBA] SendKeys "{DOWN}"

...it behaves like CTRL+SHIFT+Down Arrow, selecting all the contiguous
non-blank cells below the active cell. That's not as advertised,
right?? (I have to remember not to execute this statement while in the
VBA editor, because from there it just moves the VBA editor's cursor.)
This is in Excel 2000.





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Move cursor down, skipping hidden rows

Wow! Nice, thanks!
Dan

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
Skipping Rows with cursor bill007 Excel Discussion (Misc queries) 1 July 9th 09 10:47 PM
Move cursor 5 rows down Tracy Excel Discussion (Misc queries) 1 September 26th 08 05:14 PM
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Can I paste data skipping the hidden cells ? tclark67 Excel Discussion (Misc queries) 3 August 22nd 05 07:04 PM
HOW TO MOVE CURSOR Fernando Duran Excel Programming 2 September 17th 03 06:55 PM


All times are GMT +1. The time now is 06:24 PM.

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"