Vincent88
Active Member
- Joined
- Mar 5, 2021
- Messages
- 382
- Office Version
- 2019
- Platform
- Windows
- Mobile
Please help to see where the errors are if I want to move from B2 to D2 when B2 data is selected from a dropdown list. , so does other rows in B column in dynamic range.
VBA Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'Move Cursor to Column D after Row B data selected
Dim b As String, Lr As Long
If Target.Column = 2 Then
If Not Intersect(Target, Range("B2:B" & Lr)) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
Application.EnableEvents = False
b = Target.Value
If b <> "" Then
Range("D" & ActiveCell.Row).Select
Else
ActiveCell.Select
End If
Application.EnableEvents = True
End Sub