Moving between cells by using TAB or ENTER key in a specific order...how to do? Excel 2010

MarkSalesses

New Member
Joined
May 1, 2014
Messages
9
I don't know why this is so hard to find an answer for but have been searching online and so thought I would post.

Have developed a form for my associates and want them to be able to move to the cellls I want them to fill data in to by merely hitting the TAB or ENTER key vs. having to move the cursor to each cell requiring them to input data.

Want cursor to move in a specific cell order. You would think you could merely say 1M, 2C, etc., and maybe that's it but can't figure out or find. Feel free to email me or call if you wish to Mark Salessses 202-317-0888 or mark.salesses@eurestservices.us

Much appreciated.

P.S. Would like step by step instructions as it would be my first time and don't want to miss anything.
 
You can't enter the cell order, but once the cells you want are unlocked and everything else is locked pressing "TAB" will naturally move through the cells in the order you want.

If you want to move in that order regardless of which key is pressed, then you need a macro.
 
Upvote 0
Sorry I didn't notice that you jump back to row 11 after row 31 in your order... However, this might work for you:
Code:
Dim oldCell As String

Private Sub Worksheet_Activate()
    SetOldCell
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim arrTabOrder
    Dim nextRng As Range
    Dim i As Long
    
    arrTabOrder = Array("$A$1", "$B$3", "$C$1", "$C$4", "$A$2", "$B$1")
    
    For i = 0 To UBound(arrTabOrder) - 1
        If oldCell = arrTabOrder(i) Then Exit For
    Next i
    If i = UBound(arrTabOrder) Then i = -1  'Loop back to element 0
    Set nextRng = Range(arrTabOrder(i + 1))
    nextRng.Activate
    SetOldCell
    
End Sub

Private Sub SetOldCell()
    oldCell = ActiveCell.Address
End Sub

From the sheet you wnat this applied to, press alt-F11 to open VBE (Editor). In the editor, select (double-click) the sheet from the navigation pane (on the left) that you want this applied to. Paste the code above into the editor pane.

In my limited testing it seems to work.

You'll need to change the cell values in arrTabOrder - within the parentheses of the Array function. Use quotes and absolute references ($) - also letters (columns) go first, then numbers (rows)...

HTH,
~ Jim
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top