Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Help required to select a cell in a filtered list

Windows XP and Excel 2003
I have filtered some rows of data and would like to move the active cell
sequentially down the list.
Equivalent to using the cursor down key ... Is this possible with vba

Regards & TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Help required to select a cell in a filtered list

I'd just look for a row that's visible:

Option Explicit
Sub testme()

Dim iRow As Long
Dim FirstRow As Long
Dim LastRow As Long
Dim CurRow As Long

CurRow = ActiveCell.Row
With ActiveSheet.AutoFilter.Range
FirstRow = .Row
LastRow = .Rows(.Rows.Count).Row
End With

If CurRow = LastRow _
Or CurRow < FirstRow Then
MsgBox "not in the autofilter range--or out of room!"
Exit Sub
End If

Do
If ActiveCell.Row = LastRow Then
Exit Do 'at the bottom of the range
End If

ActiveCell.Offset(1, 0).Select

If ActiveCell.Row LastRow Then
MsgBox "Out of the autofilter range!"
Exit Do
End If

If ActiveCell.EntireRow.Hidden = True Then
'keep looking
Else
Exit Do
End If
Loop

End Sub

Jim wrote:

Windows XP and Excel 2003
I have filtered some rows of data and would like to move the active cell
sequentially down the list.
Equivalent to using the cursor down key ... Is this possible with vba

Regards & TIA


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Randomly Select cell from filtered list Matt Ferguson Excel Worksheet Functions 1 November 26th 09 02:12 AM
select random sample of records in a filtered list David3553 Excel Discussion (Misc queries) 2 November 25th 09 11:37 PM
SELECT THE FIRST CELL IN ADVANCE FILTERed worksheet vba code CmK Excel Programming 2 June 10th 07 12:53 PM
How do I select the first cell of a filtered list? Shane Moore Excel Worksheet Functions 2 August 15th 06 02:18 PM
Select data in filtered list Stephen Rainey Excel Discussion (Misc queries) 2 July 28th 06 12:38 PM


All times are GMT +1. The time now is 12:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"