#1   Report Post  
Posted to microsoft.public.excel.misc
Wu Wu is offline
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Wu Wu is offline
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Wu Wu is offline
external usenet poster
 
Posts: 36
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,388
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,346
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,231
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 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
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
where can I see my question and answer? Yesterday I ask a question IP Excel Discussion (Misc queries) 2 May 10th 08 04:08 PM
An IF question pcor New Users to Excel 1 December 13th 06 05:05 PM
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
The question is an excel question that I need to figure out howto do in excel. Terry Excel Worksheet Functions 3 January 23rd 06 06:22 PM
Yup - another question! Oggie Ben Doggie Excel Worksheet Functions 6 November 2nd 05 03:32 PM


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