After Filter - Move to first cell

T

Tempy

Could somebody please help me with the above, i am filtering with code
but am not sure of the code to move to the first displayed cell.

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
P

papou

Hi Les
Provided headers starting in A1
Try
Cells(Range("A1").CurrentRegion.Offset(1,0).SpecialCells(xlCellTypeVisible).
Row,1).Select

HTH
Cordially
Pascal
 
T

Tempy

Hi Papau,

Firstly, i the first 5 rows are used for the header, so my data begins
at row 6. The spreadsheet has a lot of grouped coloumns and the data i
want is about in the middle "Field:=22".

I treid your code and it jumps to the cell A2.

Thanks your help is appreciated.

Les Stout

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
P

Papou

Well, try and amend from A1 to A5 and see if it works.
I never use more than 1 row for headers because, to my opinion, it messes
things.
But as I have just said this is only a personal point of view.

HTH
Cordially
Pascal
 
D

Dave Peterson

Not sure why you want to move to that first visible cell, but here's an example
to find the first visible cell in the first column of the autofilter range (not
counting the header row).

Option Explicit
Sub testme01()
Dim rngF As Range
With ActiveSheet.AutoFilter.Range.Columns(1)
Set rngF = .Resize(.Rows.Count - 1).Offset(1, 0) _
.Cells.SpecialCells(xlCellTypeVisible)
End With
MsgBox rngF.Cells(1).Address
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