Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Using Arrow keys in a macro

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?

  #2   Report Post  
Posted to microsoft.public.excel.programming
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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default Using Arrow keys in a macro

Thanks Mike, that works fine! I knew there must be a way.
Regards,
Keith

"Mike Fogleman" wrote:

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?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 947
Default Using Arrow keys in a macro

Just another option to select the next visible cell down:

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

--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"Kevryl" wrote in message
...
Thanks Mike, that works fine! I knew there must be a way.
Regards,
Keith

"Mike Fogleman" wrote:

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?






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
Arrow Keys Tim Excel Discussion (Misc queries) 1 January 24th 08 06:10 PM
Arrow Keys longfingers Excel Discussion (Misc queries) 2 September 14th 07 05:19 AM
Arrow keys Harley Excel Programming 2 January 26th 06 03:08 PM
how to use shift and down arrow keys in a macro? John W Excel Worksheet Functions 1 July 31st 05 01:21 AM
macro equivalent to arrow keys Jim Robinson[_2_] Excel Programming 7 July 13th 05 04:09 PM


All times are GMT +1. The time now is 06:58 AM.

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

About Us

"It's about Microsoft Excel"