tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone,
The code below is a stop for a protected sheet so the tabing doesn't go everywhere,
however it only works on column G,
how can I change it so it works on G:M?
thanks
Tony
The code below is a stop for a protected sheet so the tabing doesn't go everywhere,
however it only works on column G,
how can I change it so it works on G:M?
thanks
Tony
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
LastR = Sheets("Weekly Data Input").Cells(Rows.Count, "F").End(xlUp).Row
With Application
If Target.Address = Range("G" & LastR).Address Then
.OnKey "{TAB}", Me.CodeName & ".GoBack"
.OnKey "{ENTER}", Me.CodeName & ".GoBack"
.OnKey "{Down}", Me.CodeName & ".GoBack"
.OnKey "~", Me.CodeName & ".GoBack"
Else
.OnKey "{TAB}"
.OnKey "{ENTER}"
.OnKey "{Down}"
.OnKey "~"
End If
End With
End Sub
Private Sub GoBack()
LastR = Sheets("Weekly Data Input").Cells(Rows.Count, "F").End(xlUp).Row
Range("G" & LastR).Select
End Sub