tonywatsonhelp
Well-known Member
- Joined
- Feb 24, 2014
- Messages
- 3,210
- Office Version
- 365
- 2019
- 2016
- Platform
- Windows
Hi Everyone,
The code below works great, but I'd like to expand its target from Column G to Columns G:M
any ideas the best way to do this?
Thanks
Tony
The code below works great, but I'd like to expand its target from Column G to Columns G:M
any ideas the best way to do this?
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
Shapes.Range(Array("Group 3")).Top = ActiveWindow.VisibleRange(2, 3).Top
End Sub
Private Sub GoBack()
LastR = Sheets("Weekly Data Input").Cells(Rows.Count, "F").End(xlUp).Row
Range("G" & LastR).Select
End Sub