Tab movement using Tab Key. Active Cell Color Change

DarrenBurke

New Member
Joined
May 6, 2022
Messages
29
Office Version
  1. 2016
  2. 2007
Platform
  1. Windows
Hi Guys and Ladies

I have an Array for using the Tab Key. I would like the color (colour... for english UK) of the active cell to change as the user tabs through the sheet. Basically to see what cell he/she is currently on.

My code for the sheet. Tab key works perfect, a bit of bling would be nice Cheers and thank you for the help.

VBA Code:
Private Sub TabOrder()
     
     'Set applicable sheet name
    Const TabSheet = "PICKUP COPY1"
    Dim Limit As Integer, NumPos As Integer
    Dim NextPos As String, MyCel As String
    Dim MyTO
     
     'Set tab offset for other sheets
    If ActiveSheet.Name <> TabSheet Then
        ActiveCell.Offset(0, 1).Select
        Exit Sub
    End If
     'Set your cells in desired order
    MyTO = Array("C7", "C6", "E4", "C8", "C10", "C12", "C14", "C16", "C18", "C20", "C22", "C24", "D24", "E24", "C26", "C32", "F34", "A36", "I7", "I6", "K4", "I8", "I10", "I12", "I14", "I16", "I18", "I20", "I22", "I24", "J24", "K24", "I26", "I32", "L34", "G36", "O7", "O6", "Q4", "O8", "O10", "O12", "O14", "O16", "O18", "O20", "O22", "O24", "P24", "Q24", "O26", "O32", "R34", "M36", "S46")
    Limit = UBound(MyTO)
    MyCel = ActiveCell.Address(0, 0)
     'Check for match in array
    On Error GoTo LastLine
    NumPos = Application.WorksheetFunction.Match(MyCel, MyTO, 0)
     'Return to first cell
    If NumPos = Limit Then
        NextPos = MyTO(1)
    Else
        NextPos = MyTO(NumPos + 1)
    End If
    Range(NextPos).Activate
    Exit Sub
LastLine:
     'Set tab offset if named cell not found
    ActiveCell.Offset(0, 1).Select
End Sub
 
I thought the code that I added to assist OP in post #17 was all that was required...
It was all that was required - but it should really have been provided at post #13 when you provided the link to it.
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

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