Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2019, 03:49 PM
byron byron is offline macro to auto move cursor to start column Mac OS X macro to auto move cursor to start column Office 2019
Novice
macro to auto move cursor to start column
 
Join Date: Dec 2019
Posts: 6
byron is on a distinguished road
Default macro to auto move cursor to start column

Hi I am trying to find a macro to auto move the curser after pressing enter for example.

After typing in data in cells a1 a2 a3 a4 a5 a6 when I hit enter on cell a6 the curser auto moves to cell b1 and again when getting to b6 and hit enter it moves to c1 and so forth
can anyone please help.
Reply With Quote
  #2  
Old 12-22-2019, 04:20 PM
p45cal's Avatar
p45cal p45cal is offline macro to auto move cursor to start column Windows 10 macro to auto move cursor to start column Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

There are several ways.
1. Select the cells A1:C6, start typing, press Enter, type some more, repeat. It will take you to the cells in the order you want providing you've kept Direction: Down for After pressing Enter, move selection at the top of the Editing Options of the Advanced section of Excel's Options (the default)
2. Select the cells A1:C6, go into Format cells and in the Protection tab, untick the Locked checkbox. Then protect the sheet, unticking the checkbox Select Locked Cells before you click OK. (The same applies about After pressing Enter, move selection in solution 1 above)



If neither of these is good enough then come back.
Reply With Quote
  #3  
Old 12-22-2019, 04:41 PM
byron byron is offline macro to auto move cursor to start column Mac OS X macro to auto move cursor to start column Office 2019
Novice
macro to auto move cursor to start column
 
Join Date: Dec 2019
Posts: 6
byron is on a distinguished road
Default

Hi thank you very much for your quick reply I have to say a big sorry I have posted the question completely wrong
your answer is right but what is needed is data entered in a1,b1,c1,d1,e1,f1 then after the enter on f1 the curser moves to a2 then on reaching f2 press enter and auto move to a3 hope this makes sense. I did this with a macro a few years back but can't remember it sorry again and thanks.
Reply With Quote
  #4  
Old 12-22-2019, 04:52 PM
p45cal's Avatar
p45cal p45cal is offline macro to auto move cursor to start column Windows 10 macro to auto move cursor to start column Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Then try again after changing to Direction: Right for After pressing Enter in options.
Reply With Quote
  #5  
Old 12-22-2019, 05:23 PM
p45cal's Avatar
p45cal p45cal is offline macro to auto move cursor to start column Windows 10 macro to auto move cursor to start column Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Using a macro, if you've only one area on a sheet where you want this to happen then a variation of this in the sheet's code-module:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo errhandler
Set myRng = Range("A1:F6") '<<<set your area here.
If Intersect(Target, myRng) Is Nothing Then
  Application.MoveAfterReturnDirection = xlDown
Else
  Application.EnableEvents = False
  myRng.Select: Target.Activate
  Application.EnableEvents = True
  Application.MoveAfterReturnDirection = xlToRight
End If
errhandler:
Application.EnableEvents = True
End Sub
If you have several areas on the same sheet you want to behave in this manner then a variation of this in the sheet's code-module:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo errhandler
Set myRng = Range("A1:F6,C10:F11") '<<<set your areas here.
If Intersect(Target, myRng) Is Nothing Then
  Application.MoveAfterReturnDirection = xlDown
Else
  For Each are In myRng.Areas
    If Not Intersect(are, Target) Is Nothing Then
      Set myRng = are
      Exit For
    End If
  Next are
  Application.EnableEvents = False
  myRng.Select: Target.Activate
  Application.EnableEvents = True
  Application.MoveAfterReturnDirection = xlToRight
End If
errhandler:
Application.EnableEvents = True
End Sub
Reply With Quote
  #6  
Old 12-23-2019, 05:07 AM
byron byron is offline macro to auto move cursor to start column Mac OS X macro to auto move cursor to start column Office 2019
Novice
macro to auto move cursor to start column
 
Join Date: Dec 2019
Posts: 6
byron is on a distinguished road
Default

Many thanks for your help but still can't get it working I am on a mac using 2019 version of excel does that matter ?. Also when searching google I got this
Sub jumpnext()
Range("A" & ActiveCell.Row + 1).Select
End Sub

does it make any sense to you as I can't get this working either I know that a few years ago I got what I wanted with the above or something very similar but on a windows pc.
anymore help would be much appreciated.
Reply With Quote
  #7  
Old 12-23-2019, 05:09 AM
byron byron is offline macro to auto move cursor to start column Mac OS X macro to auto move cursor to start column Office 2019
Novice
macro to auto move cursor to start column
 
Join Date: Dec 2019
Posts: 6
byron is on a distinguished road
Default

just to let you know it is a stamp collection work sheet I am trying to put together.
Reply With Quote
  #8  
Old 12-23-2019, 05:38 AM
p45cal's Avatar
p45cal p45cal is offline macro to auto move cursor to start column Windows 10 macro to auto move cursor to start column Office 2019
Expert
 
Join Date: Apr 2014
Posts: 863
p45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant futurep45cal has a brilliant future
Default

Quote:
Originally Posted by byron View Post
I am on a mac using 2019 version of excel does that matter ?.
It begins to look like it does. I know nothing if the Mac's version of Excel's idiosyncrasies!
Quote:
Originally Posted by byron View Post
Also when searching google I got this
Sub jumpnext()
Range("A" & ActiveCell.Row + 1).Select
End Sub
This snippet, when run will move the selection from the currently active cell to column A of the row below.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Needed to Move Info from Column A to Column B and C rsrasc Excel Programming 5 04-01-2018 06:05 AM
macro to auto move cursor to start column A macro to find a symbol, delete it, and move the cursor to that location JayBird24 Word VBA 1 08-19-2016 04:26 PM
macro to auto move cursor to start column move cursor anand Word VBA 14 07-07-2015 05:57 AM
How do I move the cursor back to the text from a comment without using the mouse? MsT Word 2 04-24-2014 05:48 PM
can't move the cursor in Word pieboy Word 2 02-13-2009 07:15 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft