Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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.................. |
#11
Posted to microsoft.public.excel.misc
|
|||
|
|||
BIG question
"Rick Rothstein" wrote...
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 .... Close. Make the C5 address in aTabOrder AC5 instead, then enter something in C5. FUBAR! Make the .Select method call Range(Trim(Split(Split(" " & aTabOrd & " " & aTabOrd, _ " " & Target.Address(0, 0) & " ", , vbTextCompare)(1))(0))).Select Delimiters are a pain. |
#12
Posted to microsoft.public.excel.misc
|
|||
|
|||
BIG question
Do you know what annoys me about your posting? The fact that you had to post
it in the first place. I've given that same correction you gave me to others dozens of times in the past myself (both when volunteering here as well as when I volunteered in the compiled VB newsgroups)! I was concentrating on getting the wrap-around effect and completely overlooked the partial match problem (for which I could just kick myself). Anyway, thanks for catching this... I really appreciate it. -- Rick (MVP - Excel) "Harlan Grove" wrote in message ... "Rick Rothstein" wrote... 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 .... Close. Make the C5 address in aTabOrder AC5 instead, then enter something in C5. FUBAR! Make the .Select method call Range(Trim(Split(Split(" " & aTabOrd & " " & aTabOrd, _ " " & Target.Address(0, 0) & " ", , vbTextCompare)(1))(0))).Select Delimiters are a pain. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
where can I see my question and answer? Yesterday I ask a question | Excel Discussion (Misc queries) | |||
An IF question | New Users to Excel | |||
Newbie Question - Subtraction Formula Question | Excel Discussion (Misc queries) | |||
The question is an excel question that I need to figure out howto do in excel. | Excel Worksheet Functions | |||
Yup - another question! | Excel Worksheet Functions |