Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 151
Default moving the cursor in a macro

How do I move up one cell from where the cursor is in a macro (which could be
a random location in a workbook).
I don't want the cursor to be in a fixed location.
For example, if the cursor was in A4 before I run the macro. I want the
macro to move the cursor to A3. If the cursor was in B12 before I run the
macro, I want the cursor to move to B11.

p.s. I've tried using the arrow key as well as Shift Enter neither works.

Amanda
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default moving the cursor in a macro

the macro recorder only records the results of your actions, not the
steps or keypresses.

One way:

Put this in as the first lines of your macro:

With ActiveCell
If .Row = 1 Then Exit Sub
.Offset(-1, 0).Activate
End With



In article ,
Amanda wrote:

How do I move up one cell from where the cursor is in a macro (which could be
a random location in a workbook).
I don't want the cursor to be in a fixed location.
For example, if the cursor was in A4 before I run the macro. I want the
macro to move the cursor to A3. If the cursor was in B12 before I run the
macro, I want the cursor to move to B11.

p.s. I've tried using the arrow key as well as Shift Enter neither works.

Amanda

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
moving cursor PECOSBOB Excel Worksheet Functions 1 January 17th 09 01:27 PM
moving cursor aby New Users to Excel 2 November 2nd 08 10:45 PM
Moving cursor around excel Rare Earth Excel Discussion (Misc queries) 1 October 7th 08 11:52 PM
Moving Cursor within same cell nishockey19 Excel Discussion (Misc queries) 6 August 28th 08 09:14 PM
moving cursor through the cells jcheko Excel Worksheet Functions 2 April 24th 08 04:25 PM


All times are GMT +1. The time now is 09:09 PM.

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"