Seeking VBA Code for Cursor Movements

Ken1000

Active Member
Joined
Sep 28, 2003
Messages
315
Hi. I am using Excel 2000 and am new to using VBA.
What I need is the VBA code for simple cusor movements.
(These may sound crazy, but I have sound reasons
for needing this code.)

What is the VBA code to move the cursor (not the contents)
-- just the cursor ...
one cell DOWN ? one cell UP ? one cell to the RIGHT ?
one cell to the LEFT ?

Likewise, what is the VBA code to move 5 cells DOWN ?
5 cells UP ? 5 cells to the RIGHT ? 5 cells to the LEFT ?

Also, suppose a column is filled with 10 rows of data and
the cursor is at the top of the column/list. What VBA code
woudl move the cursor instantly DOWN to the END of that row
of data (to the 10th row). (Need to know what is the equiv.
of the manually applied END-DOWN keystroke sequence.)

Similarly, what is the VBA code for manually applied END-
RIGHT keystroke sequence.

Last, is there any web reference you can recommend which
shows coding examples for old Lotus 123 macro commands
to their equivalents in Excel 2000 VBA code ?

I know I've asked a lot. I truly appreciate any help you can
send my way.

Thanks very much ... Ken
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Just some off the top of my head:

Move one cell down
ActiveCell.Offset(1, 0).Select

Move one cell up
ActiveCell.Offset(-1, 0).Select

Move one cell right
ActiveCell.Offset(0, 1).Select

Move one cell left
ActiveCell.Offset(0, -1).Select

To move more than one cell in any direction, simply change the 1 or -1 to however many cells you want to move over.

Equivalent of Ctrl+End
ActiveCell.SpecialCells(xlLastCell).Select

You can also use the macro recorder to experiment and see what code results from your actions in Excel.

Hope it at least gets you started,
 
Upvote 0

Forum statistics

Threads
1,215,833
Messages
6,127,153
Members
449,366
Latest member
reidel

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top