Go To A Particular Cell After Inputting Data In Another Cell And Hitting Enter Options
excel, vba
Solution
Another way.
- If you type anywhere in Col A, the selection will move to Col B.
- If you type anywhere in Col B, the selection will move to Col C.
- If you type anywhere in Col C, the selection will move back to Col A (Next Line).
Code: This goes in the relevant sheet code area.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Whoa
Application.EnableEvents = False
If Not Target.Cells.CountLarge > 1 Then
If Not Intersect(Target, Columns(1)) Is Nothing Then
Target.Offset(, 1).Select
ElseIf Not Intersect(Target, Columns(2)) Is Nothing Then
Target.Offset(, 1).Select
ElseIf Not Intersect(Target, Columns(3)) Is Nothing Then
Target.Offset(1, -2).Select
End If
End If
Letscontinue:
Application.EnableEvents = True
Exit Sub
Whoa:
MsgBox Err.Description
Resume Letscontinue
End Sub
ScreenShot
Problem
I have a Excel sheet and I'm inputting data in A2, B2 and C2; after I hit enter I want the cursor select the next line so I can input information on A3, B3 and C3 and so on I found this information ``` Private Sub Worksheet_Change(ByVal Target As Excel.Range) If Range("C2").Value <> "" Then Range("A3").Select End If End Sub ``` But it only works one time, how can I repeat this process over and over Thanks for your help.....