ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Navigating in filtered rows (https://www.excelbanter.com/excel-discussion-misc-queries/72868-navigating-filtered-rows.html)

anandmr65

Navigating in filtered rows
 

Hi,

I need help on following problem.

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

Could somebdy please help me on this with a macro.

Thanks for help in advance

Regards
Anand


--
anandmr65
------------------------------------------------------------------------
anandmr65's Profile: http://www.excelforum.com/member.php...o&userid=30728
View this thread: http://www.excelforum.com/showthread...hreadid=514657


Norman Jones

Navigating in filtered rows
 
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
'<<=============


---
Regards,
Norman



"anandmr65" wrote
in message ...

Hi,

I need help on following problem.

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

Could somebdy please help me on this with a macro.

Thanks for help in advance

Regards
Anand


--
anandmr65
------------------------------------------------------------------------
anandmr65's Profile:
http://www.excelforum.com/member.php...o&userid=30728
View this thread: http://www.excelforum.com/showthread...hreadid=514657




anandmr65

Navigating in filtered rows
 

Thanks a lot for the help. I will try this solution out.

Regards
Anand


--
anandmr65
------------------------------------------------------------------------
anandmr65's Profile: http://www.excelforum.com/member.php...o&userid=30728
View this thread: http://www.excelforum.com/showthread...hreadid=514657



All times are GMT +1. The time now is 08:31 PM.

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