View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default Using Arrow keys in a macro

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
"Kevryl" wrote in message
...
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?