Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default move to the right after hitting enter using macros

Hi All,

I am attempting to cause movement 4 cells to the right of present location
after I enter data and press enter. I had thought a Macro would do this, but
I can't tie a Macro to a cell and a separate button always takes me to the
original cell. How can I make the movement go right four cells and wait for
input after hitting enter in the previous cell?

Thanks, Al
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default move to the right after hitting enter using macros

This example is coded for cell B9, but it can be modified for any set of
cells. Enter the following event macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
Set r = Range("B9")
If Intersect(Target, r) Is Nothing Then Exit Sub
Range("F9").Select
End Sub

Once the macro has been installed, entering data in B9 will cause you to
jump to F9.


Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm

--
Gary''s Student - gsnu200908


"Santa Fe Al" wrote:

Hi All,

I am attempting to cause movement 4 cells to the right of present location
after I enter data and press enter. I had thought a Macro would do this, but
I can't tie a Macro to a cell and a separate button always takes me to the
original cell. How can I make the movement go right four cells and wait for
input after hitting enter in the previous cell?

Thanks, Al

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default move to the right after hitting enter using macros

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo endit
Application.EnableEvents = False
Target.Offset(0, 4).Select
endit:
Application.EnableEvents = True
End Sub

This sheet event code. Right-click the sheet tab and "View Code"

Copy/paste into that module.

Alt + q to return to Excel.


Gord Dibben MS Excel MVP

On Wed, 18 Nov 2009 10:26:01 -0800, Santa Fe Al <Santa Fe
wrote:

Hi All,

I am attempting to cause movement 4 cells to the right of present location
after I enter data and press enter. I had thought a Macro would do this, but
I can't tie a Macro to a cell and a separate button always takes me to the
original cell. How can I make the movement go right four cells and wait for
input after hitting enter in the previous cell?

Thanks, Al


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
Automatically move to adjacent cells without hitting Enter Doug Excel Discussion (Misc queries) 7 August 11th 09 07:14 PM
numbers appear different after hitting enter cb New Users to Excel 3 March 27th 08 10:46 PM
Hitting Enter to Move Cursor to the Next Entry Cell Cisnerax Excel Worksheet Functions 3 February 25th 06 11:04 AM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM
Cursor not to move when hitting the enter key Alex Martinez Excel Worksheet Functions 1 May 12th 05 05:40 AM


All times are GMT +1. The time now is 03:33 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"