-
Solved: move between cells on a filtered list
Hi
I filtered a table like this:
[VBA]
ThisWorkbook.Sheets(1).Range(DBRange).AutoFilter Field:=Col3, Criteria1:=Val
[/VBA]
The result of the filter gives me list of ID's on the first column that I need to do something with. In other words I need to check all the filtered values on the first column.
I started with:
[VBA]
ThisWorkbook.Sheets(1).Activate
ThisWorkbook.Sheets(1).Cells(1, 1).Select
[/VBA]
and then if I do the following - I get all values even if they are hidden.
[VBA]
While ActiveCell.Offset(i, 0).Value <> ""
ID = ActiveCell.Offset(i,0).Value
i = i + 1
Wend
[/VBA]
When I do it manually with key arrows (not via VBA) I jump only on the visible cells like I want to.
How can I run on all visible cells ? do I need to check visibility or can I do something like XlDown somewhere ?
-
Try something like (untested):[VBA]For Each cll In Range(DBRange).Columns(1).SpecialCells(xlCellTypeVisible).Cells
ID = cll.Value
Next cll
[/VBA]
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
-
Thanks a lot. Exactly what I needed...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules