If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
BIG question
I would like to write a marco that:
Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#2
|
|||
|
|||
BIG question
Think you can just change the setting to suit ..
Click Tools Options Edit tab Select as desired from the droplist for "Move selection after Enter", ie select: Right, then OK out Voila? Express it, click the YES button below -- Max Singapore http://savefile.com/projects/236895 Downloads:25,000 Files:300 Subscribers:70 xdemechanik --- "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#3
|
|||
|
|||
BIG question
I need not only move the cursor to right after inputing data.
How to write the marco to specifiy where the cursor to move after input data "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#4
|
|||
|
|||
BIG question
But I need not only move to right. How to write the marco to move to specified direction after [ENTER], such as move down , move up............... "Max" wrote: Think you can just change the setting to suit .. Click Tools Options Edit tab Select as desired from the droplist for "Move selection after Enter", ie select: Right, then OK out Voila? Express it, click the YES button below -- Max Singapore http://savefile.com/projects/236895 Downloads:25,000 Files:300 Subscribers:70 xdemechanik --- "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#5
|
|||
|
|||
BIG question
This is one way *without* using a macro:
http://tinyurl.com/2gzlwp -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "Wu" wrote in message ... I need not only move the cursor to right after inputing data. How to write the marco to specifiy where the cursor to move after input data "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#6
|
|||
|
|||
BIG question
Hi
If you are looking for a macro. Right click the sheetView Code and paste the code. The below macro works in the range Col A:B . Move to right from A to B and then again get back to A...next row..In the below code lngRow and lngCol determine the next cell . Target.Row is the current row and Target.Column is the current column. Adjust to suit... Private Sub Worksheet_Change(ByVal Target As Range) Dim rngTemp As Range Dim lngCol As Long, lngRow As Long Set rngTemp = Range("A:B") Application.EnableEvents = False If Not Application.Intersect(Target, rngTemp) Is Nothing Then lngCol = IIf(Target.Column = rngTemp.Column, _ Target.Column + 1, rngTemp.Column) lngRow = IIf(Target.Column = rngTemp.Column, _ Target.Row, Target.Row + 1) Cells(lngRow, lngCol).Select End If Application.EnableEvents = True End Sub If this post helps click Yes --------------- Jacob Skaria "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#7
|
|||
|
|||
BIG question
Private Sub Worksheet_Change(ByVal Target As Range)
'Anne Troy's taborder event code Dim aTabOrd As Variant Dim i As Long 'Set the tab order of input cells aTabOrd = Array("A5", "B22", "C5", "A11", "D10", "F7") 'Loop through the array of cell address For i = LBound(aTabOrd) To UBound(aTabOrd) 'If the cell that's changed is in the array If aTabOrd(i) = Target.Address(0, 0) Then 'If the cell that's changed is the last in the array If i = UBound(aTabOrd) Then 'Select first cell in the array Me.Range(aTabOrd(LBound(aTabOrd))).Select Else 'Select next cell in the array Me.Range(aTabOrd(i + 1)).Select End If End If Next i End Sub Gord Dibben MS Excel MVP On Sat, 13 Jun 2009 17:33:01 -0700, Wu wrote: But I need not only move to right. How to write the marco to move to specified direction after [ENTER], such as move down , move up............... "Max" wrote: Think you can just change the setting to suit .. Click Tools Options Edit tab Select as desired from the droplist for "Move selection after Enter", ie select: Right, then OK out Voila? Express it, click the YES button below -- Max Singapore http://savefile.com/projects/236895 Downloads:25,000 Files:300 Subscribers:70 xdemechanik --- "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#8
|
|||
|
|||
BIG question
Hi Wu,
If you have a number of cells dotted over your sheet that require data, you could use the following: Unlock only the cells you want to enter data into. Protect the sheet; no need for a password. Now hit the TAB key. Successive hits on the TAB key will select each cell you unlocked. So after data entry, hit TAB instead of enter. "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#9
|
|||
|
|||
BIG question
Hi,
Press Tab instead of Enter to move to the Right Press Shift+Tab instead of Enter to move to the Left Press Shift+Enter instead of Enter to move Up However, if you use the cursor keys instead of Enter you also move in the appropriate direction - Left, Right, Up or Down arrows keys All of these enter the data as the move the cursor. -- If this helps, please click the Yes button. Cheers, Shane Devenshire "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
#10
|
|||
|
|||
BIG question
I believe this shorter code will function identically to the code you
posted... Private Sub Worksheet_Change(ByVal Target As Range) ' Set the tab order of input cells in a space delimited list Const aTabOrd As String = "A5 B22 C5 A11 D10 F7" On Error Resume Next Range(Trim(Split(Split(aTabOrd & " " & aTabOrd, Target.Address(0, 0) _ & " ", , vbTextCompare)(1))(0))).Select End Sub -- Rick (MVP - Excel) "Gord Dibben" gorddibbATshawDOTca wrote in message ... Private Sub Worksheet_Change(ByVal Target As Range) 'Anne Troy's taborder event code Dim aTabOrd As Variant Dim i As Long 'Set the tab order of input cells aTabOrd = Array("A5", "B22", "C5", "A11", "D10", "F7") 'Loop through the array of cell address For i = LBound(aTabOrd) To UBound(aTabOrd) 'If the cell that's changed is in the array If aTabOrd(i) = Target.Address(0, 0) Then 'If the cell that's changed is the last in the array If i = UBound(aTabOrd) Then 'Select first cell in the array Me.Range(aTabOrd(LBound(aTabOrd))).Select Else 'Select next cell in the array Me.Range(aTabOrd(i + 1)).Select End If End If Next i End Sub Gord Dibben MS Excel MVP On Sat, 13 Jun 2009 17:33:01 -0700, Wu wrote: But I need not only move to right. How to write the marco to move to specified direction after [ENTER], such as move down , move up............... "Max" wrote: Think you can just change the setting to suit .. Click Tools Options Edit tab Select as desired from the droplist for "Move selection after Enter", ie select: Right, then OK out Voila? Express it, click the YES button below -- Max Singapore http://savefile.com/projects/236895 Downloads:25,000 Files:300 Subscribers:70 xdemechanik --- "Wu" wrote: I would like to write a marco that: Let me input data in a cell, and when I [ENTER], the cursor will move to right cell to let me input data again.................. |
|
Thread Tools | |
Display Modes | |
|
|