ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select the next row (https://www.excelbanter.com/excel-programming/346226-select-next-row.html)

Glen Mettler[_2_]

Select the next row
 

How can I select the next row in a filtered condition?
For example - I have a filter set that shows:
Row 1& 2 (header rows)
Row 4 - data row
Row 10 - data row

If I use Activecell.offset(1,0).select, I get row 3
I need to be able to select the next visible row (in this case row 4) in the
same way that I can do it if I press the down arrow
but I need to do it programmatically.

Any ideas?

Glen




Norman Jones

Select the next row
 
Hi Glen.

Try the following which was suggested by Tom Ogilvy:

'==============
Sub SelectNextVisible()
Dim Rng As Range

Set Rng = Range(ActiveCell.Offset(1), _
ActiveCell.Offset(1).End(xlDown)). _
SpecialCells(xlVisible)
Rng(1).Select

End Sub
'<<==============


---
Regards,
Norman



"Glen Mettler" wrote in message
...

How can I select the next row in a filtered condition?
For example - I have a filter set that shows:
Row 1& 2 (header rows)
Row 4 - data row
Row 10 - data row

If I use Activecell.offset(1,0).select, I get row 3
I need to be able to select the next visible row (in this case row 4) in
the same way that I can do it if I press the down arrow
but I need to do it programmatically.

Any ideas?

Glen







All times are GMT +1. The time now is 10:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com