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

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
268
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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows
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
 
Solution

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
268
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
Hi My Aswer Is This,
It doesn't work😪
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows
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?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

I know nothing about Windows Mobile so maybe that is the problem.
I'm using Excel 2013
 

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
268
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
Hi My Aswer Is This,
There is no error. It just move down to next row.
I am using O365 or Office 2019
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

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
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows
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.
 

Vincent88

Active Member
Joined
Mar 5, 2021
Messages
268
Office Version
  1. 2019
Platform
  1. Windows
  2. Mobile
Hi My Aswser is This,
I just want the function applies to B cells except B1. Sorry !
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,674
Office Version
  1. 2013
Platform
  1. Windows
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
 

Forum statistics

Threads
1,141,002
Messages
5,703,663
Members
421,310
Latest member
CindaH

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
Top