VBa to tab to the cells i want

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
2,744
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi everyone,
not sure if this is possible but i need my sheet to keep the tab and enter keys from moving data into the wrong cells

heres what i need

E8 goes to G8 goes to E11 goes to G11 goes to E14 goes to E8

p.s. The sheet is page protected and all other cells in the range of E8:G14 are locked

so basically if someone adds data into any of the above cells, it locks them into that loop, so tab or enter keys move then to the desired next cell
if they select cells outside of this range then it should just behave as normal.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

offthelip

Well-known Member
Joined
Dec 23, 2017
Messages
1,820
Office Version
  1. 2010
Platform
  1. Windows
put this in the worksheet code:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
seq = Array("$E$8", "$G$8", "$E$11", "$G$11", "$E$14")
For i = 0 To 4
    If Target.Address = seq(i) Then
        If i < 4 Then
        Range(seq(i + 1)).Select
        Else
        Range(seq(0)).Select
        End If
        Exit For
    End If
Next i
End Sub
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,130,404
Messages
5,641,940
Members
417,249
Latest member
Quysinboy

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
Top