how to go the the next row when autofilter is activated

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I would like to use something like activeCell.Offset(1,0).Select when
autofilter is activated. How do I code this ?

Many thanks.

Francois
 
Maybe just looping through the cells??

Option Explicit
Sub testme()

Dim myCell As Range

Set myCell = ActiveCell
Do
Set myCell = myCell.Offset(1, 0)
If Intersect(myCell, ActiveSheet.AutoFilter.Range) Is Nothing Then
Set myCell = Nothing
Exit Do
End If
If myCell.EntireRow.Hidden = True Then
'keep looking
Else
Exit Do
End If
Loop

If myCell Is Nothing Then
MsgBox "No next cell"
Else
MsgBox myCell.Value & vbLf & myCell.Address
myCell.Select
End If
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

Back
Top