VBa to tab to the cells i want

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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
 
Upvote 0
Solution

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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