Move to another cell in same row when active cell is filled

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
382
Office Version
  1. 2019
Platform
  1. Windows
  2. 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
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  5/30/2021  12:02:04 AM  EDT
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
    If Target.Column = 2 And Target.Row > 1 Then
    Target.Offset(, 2).Select
End If

End Sub
 
Upvote 0
Solution
Hi My Aswer Is This,
It doesn't work?
What does not work?
If you manually enter a value in column 2 then the script should select the cell in column D

What does the script do then?
Does it error out or what?
 
Upvote 0
I know nothing about Windows Mobile so maybe that is the problem.
I'm using Excel 2013
 
Upvote 0
Hi My Aswer Is This,
There is no error. It just move down to next row.
I am using O365 or Office 2019
 
Upvote 0
Hi My Aswer Is This,
There is no error. It just move down to next row.
Well your original post said:
Move to another cell in same row when active cell is filled

That what you say the script does.

So what else do you want?

You also said:
I want to move from B2 to D2
 
Upvote 0
If you want to enter a value in column B and then Goto D
And then if you enter a value in D go to G and then: on and on you must be specific.
 
Upvote 0
Hi My Aswser is This,
I just want the function applies to B cells except B1. Sorry !
 
Upvote 0
Hi My Aswser is This,
I just want the function applies to B cells except B1. Sorry !
That what my script does:
See Here:
If Target.Column = 2 And Target.Row > 1 Then

This means if you enter a value in column 2 and row number is greater then 1

The script runs selecting cell in column D same row
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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