Select the next row

G

Glen Mettler

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
 
N

Norman Jones

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
'<<==============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top