Using Arrow keys in a macro

G

Guest

I need to use an arrow key in a macro to move to the next row down. The
"offset" command is of no use because I have filtered the rows by this stage
and it lands the cursor in a filtered out row, rather than the next visible
row down. I suspect that if I can find out how to use the "End(x1down)"
without the "End" it will operate only across the visible rows, because
"End(x1down)" does .

Does anyone know the answer to the problem?
 
M

Mike Fogleman

How about a quick macro to select the next visible cell below the
activecell?

Sub NextFilterCell()
Dim i As Long

i = 1
For i = 1 To 655536
If Not ActiveCell.Offset(i, 0).EntireRow.Hidden Then
ActiveCell.Offset(i, 0).Select
Exit Sub
Else
i = i + 1
End If
Next i
End Sub


Mike F
 
D

Dana DeLouis

Just another option to select the next visible cell down:

Range(ActiveCell(2), Cells(65536, ActiveCell.Column)). _
SpecialCells(12).Areas(1).Cells(1).Select
 

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