Scrolling vertically filtered list

G

Guest

Hi,

Often I need to scroll vertically a list
(typically activecell.offset(1,0).select type of statement)

However, most often my list is filtered, and I would like the macro to jump
to only the "visible" cells. Obviously OFFSET is then not the best way to
accomplish because it goes through all rows regardless of whether it is
visible or invisible (filtered out).

What is the way to make a macro scroll from one visible row to another
visible row?

Many thanks in anticipation.
 
D

Dave Peterson

Just looping through them looking for a visible row is one way.

Option Explicit
Sub testme01()

Do
ActiveCell.Offset(1, 0).Select
If ActiveCell.EntireRow.Hidden = False Then
Exit Do
Else
'keep looking
End If
Loop

MsgBox ActiveCell.Address

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