Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro That Moves Cursor Down

When recording a macro to capture keystrokes, how do I get the curso
(or active cell) to be at the next blank cell at the bottom of
column of data?

In other words, when I use End+Down and then move the arrow key dow
one more cell, the macro record function identifies that cell by name
such as A24, rather than End+Down and then Down.

Thanks for your expertise

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Macro That Moves Cursor Down

Hi

(or active cell) to be at the next blank cell at the bottom of a
column of data?


Two ways

Range("A" & Rows.Count).End(xlUp)(2).Select

Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Select


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"job1job1 " wrote in message ...
When recording a macro to capture keystrokes, how do I get the cursor
(or active cell) to be at the next blank cell at the bottom of a
column of data?

In other words, when I use End+Down and then move the arrow key down
one more cell, the macro record function identifies that cell by name,
such as A24, rather than End+Down and then Down.

Thanks for your expertise.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Macro That Moves Cursor Down

ActiveCell.End(xldown).Select
if Activecell.row < 65536 then
Activecell.offset(1,0).Select
else
ActiveCell.End(xlup).Offset(1,0).Select
End if

or
if isempty(activeCell.Offset(1,0)) then
Activecell.offset(1,0).Select
else
ActiveCell.End(xldown).Offset(1,0).Select
End if


--
Regards,
Tom Ogilvy


"job1job1 " wrote in message
...
When recording a macro to capture keystrokes, how do I get the cursor
(or active cell) to be at the next blank cell at the bottom of a
column of data?

In other words, when I use End+Down and then move the arrow key down
one more cell, the macro record function identifies that cell by name,
such as A24, rather than End+Down and then Down.

Thanks for your expertise.


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Macro That Moves Cursor Down

job

Sub select_last_plus_one()
Dim rng As Range
Set rng = Cells(Rows.Count, 1).End(xlUp)(2)
'or .End(xlUp).Offset(1, 0)
rng.Select
End Sub

The (Rows.Count, 1) denotes column A

Gord Dibben Excel MVP

On Mon, 16 Feb 2004 13:47:46 -0600, job1job1
wrote:

When recording a macro to capture keystrokes, how do I get the cursor
(or active cell) to be at the next blank cell at the bottom of a
column of data?

In other words, when I use End+Down and then move the arrow key down
one more cell, the macro record function identifies that cell by name,
such as A24, rather than End+Down and then Down.

Thanks for your expertise.


---
Message posted from http://www.ExcelForum.com/


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
Tab key oly moves cursor to left Driftwood Excel Discussion (Misc queries) 3 June 29th 09 01:48 PM
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
Page moves instead of cursor Ralphael1 Excel Discussion (Misc queries) 2 December 23rd 06 12:14 PM
Cursor stays still, page moves StephanieH Excel Discussion (Misc queries) 2 February 28th 06 06:33 PM
My entire sheet moves instead of the cursor. What to do? Trying Excel Discussion (Misc queries) 2 February 20th 05 05:41 PM


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

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

About Us

"It's about Microsoft Excel"