Navigating in filtered rows

A

anandmr65

Hi,

I need help on following problem.

There are about 1000 rows in a sheet. When I apply Auto filter it ge
about 200 rows. I require to navigate to each of the filtered row an
do some checks and based on that some actions in each of the row.
want to do this using a macro. But I do nopt know how to navigate t
next filtered row. Offset command is taking to immediate next row an
not the visible row on filter.

Could somebdy please help me on this with a macro.

Thanks for help in advance

Regards
Anan
 
N

Norman Jones

Hi Anand,

Try something like:

'=============>>
Public Sub Tester001()
Dim rng As Range
Dim rng2 As Range
Dim rCell As Range

Set rng = ActiveSheet.AutoFilter.Range
Set rng = Intersect(rng, Columns(1))
Set rng = rng.Offset(1).Resize(rng.Rows.Count - 1)
Set rng2 = rng.SpecialCells(xlVisible)

For Each rCell In rng2.Cells
'do something, e.g.:
MsgBox rCell.Address
Next rCell

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