ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Stepping through an autofiltered list (https://www.excelbanter.com/excel-programming/330062-stepping-through-autofiltered-list.html)

Stefi

Stepping through an autofiltered list
 
Hi All,
How can I make a cycle stepping through a list previously created with
Autofilter? I need the row numbers of the list as well.
Stefi


Tom Ogilvy

Stepping through an autofiltered list
 
Dim rng as Range, rng1 as Range
Dim cell as Range
set rng = activesheet.Autofilter.Range.columns(1)
set rng = rng.offset(1,0).Resize(rng.rows.count - 1)
On error resume Next
set rng1 = rng.SpecialCells(xlVisible)
On error goto 0
if not rng1 is nothing then
for each cell in rng1
msgbox cell.Value & " - " & cell.row
Next
End If

-
"Stefi" wrote in message
...
Hi All,
How can I make a cycle stepping through a list previously created with
Autofilter? I need the row numbers of the list as well.
Stefi




Stefi

Stepping through an autofiltered list
 
Thanks, Tom! It works. It will take some time for me to understand exactly
why and how it works.
Stefi

€˛Tom Ogilvy€¯ ezt Ć*rta:

Dim rng as Range, rng1 as Range
Dim cell as Range
set rng = activesheet.Autofilter.Range.columns(1)
set rng = rng.offset(1,0).Resize(rng.rows.count - 1)
On error resume Next
set rng1 = rng.SpecialCells(xlVisible)
On error goto 0
if not rng1 is nothing then
for each cell in rng1
msgbox cell.Value & " - " & cell.row
Next
End If

-
"Stefi" wrote in message
...
Hi All,
How can I make a cycle stepping through a list previously created with
Autofilter? I need the row numbers of the list as well.
Stefi






All times are GMT +1. The time now is 09:15 AM.

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