VBA Pressing Enter Key In One Cell Will Select Another Cell

Risha

New Member
Joined
Aug 26, 2017
Messages
2
Hi, I hope someone can help me.
I'mm trying to enter data into one cell in excel like C13 and when i push the Enter key i move to cell I13 and then to F13 then L13, O13, R13, C18, F19
But if i start entering data in C14 and i press Enter then i want to go onto I14 Then F14, L14 but then i would like to move onto O13, R13, C18, F19
Can someone please help with this.
Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Maybe something like this might work for you, I'm not sure if the you're going all the way down the C column so didn't account for that, if so you could just offset those

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Application.Calculation = xlCalculationManual
    
    
    Select Case Target.Address
        Case "$C$10"
            Range("F13").Select
        Case "$F$13"
            Range("L13").Select
        Case "$L$13"
            Range("O13").Select


            
            'etc etc you get the idea


     End Select


Application.EnableEvents = True
Application.Calculation = xlCalculationAutomatic
End Sub
 
Last edited:
Upvote 0
Try any one of these code where you will name the individual ranges for each cell selection in I13 to I18.

To name the ranges, start by selecting the SECOND cell in the range, then hold down the Ctrl key and select the rest of the cells in sequence ending by selecting the FIRST cell of the range. While still selected name the range. I used the cell address with an underscore as names for three of the six cell/ranges in my examples.

When you select a cell in the I13:I18 range the named range will be highlighted. Just enter the data in the first cell and use ENTER or TAB to move to the next cell for an entry in it. Continue on thru the selected range entering data and Enter or Tab until complete. To skip a cell just hit enter twice. Select any cell outside the range to exit the selected range any time or when data entry is complete.

Also, note that with the cells you indicate you want to enter data you can have only six ranges until you will start to overwrite previous entries.

You can only have ONE of the codes in the sheet module at a time and also note I used sheet 2 for my testing, Change the sheet name to match your sheet name.

Howard

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("I13:I18")) Is Nothing _
   Or Target.Count > 1 Then Exit Sub
    
Select Case Target.Address(0, 0)
   Case "I13"
      Application.Goto Sheets("Sheet2").Range("I_13")
   Case "I14"
      Application.Goto Sheets("Sheet2").Range("I_14")
   Case "I15"
      Application.Goto Sheets("Sheet2").Range("I_15")
    
      
End Select
End Sub




Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("I13:I18")) Is Nothing _
   Or Target.Count > 1 Then Exit Sub
    
Dim varRng As Variant
Dim i As Integer


varRng = Array("I_13", "I_14", "I_15")
    
Select Case Target.Address(0, 0)
   Case "I13"
      i = 0
   Case "I14"
      i = 1
   Case "I15"
      i = 2


End Select
Application.Goto Sheets("Sheet2").Range(varRng(i))
End Sub



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("I13:I18")) Is Nothing _
   Or Target.Count > 1 Then Exit Sub
    
Select Case Target.Address(0, 0)
  Case "I13": Range("I_13").Select
  Case "I14": Range("I_14").Select
  Case "I15": Range("I_15").Select
End Select
End Sub
 
Upvote 0
This is what i have so far but the next cell in the sequence is selected no matter what i do when i only want it to move to the next cell when the enter button is pushed.
The code at the bottom is the code I'm referring to.


Code:
Private Sub Worksheet_Change(ByVal Target As Range)
            


        If Range("O8") = "Front" Then

            Call Suppress_Center_Measured_2D
            Call Suppress_Out_Riggers_Center_Measured_2D
            
        ElseIf Range("O8") = "Center" Then

            Call Suppress_Front_Measured_2D
            Call Suppress_Out_Riggers_Front_Measured_2D
        End If
            

         
        If Range("C24") = "Front" Then
            'Rows("87:93").Hidden = True
            'Rows("93:97").Hidden = False

            Call Front_Step
    
            ElseIf Range("C24") = "Rear" Then
            'Rows("87:93").Hidden = False
            'Rows("93:97").Hidden = True

            Call Rear_Step

            ElseIf Range("C86") = "Rear" And Range("I3") = "Light Weight" Then

            Call Unsuppress_Light_Weight_Rear_Step_Walkway_Support_3D

            ElseIf Range("C86") = "Front" And Range("I3") = "Light Weight" Then

            Call Unsuppress_Light_Weight_Front_Step_Walkway_Support_3D


        End If

If Target.Address = "$C$13" Then Range("I13").Select
If Target.Address = "$I$13" Then Range("F13").Select
If Target.Address = "$F$13" Then Range("L13").Select
If Target.Address = "$L$13" Then Range("O13").Select
If Target.Address = "$C$14" Then Range("I14").Select
If Target.Address = "$I$14" Then Range("F14").Select
If Target.Address = "$F$14" Then Range("L14").Select
If Target.Address = "$L$14" Then Range("O13").Select
If Target.Address = "$O$13" Then Range("R13").Select
If Target.Address = "$R$13" Then Range("C19").Select
If Target.Address = "$C$19" Then Range("F19").Select
If Target.Address = "$F$19" Then Range("C24").Select
If Target.Address = "$C$24" Then Range("F24").Select
If Target.Address = "$C$8" And Range("C8") = "Other" Then Range("D10").Select
If Target.Address = "$C$8" And Range("C8") <> "Other" Then Range("F8").Select
If Target.Address = "$D$10" Then Range("F8").Select
If Target.Address = "$F$8" Then Range("O8").Select
If Target.Address = "$O$8" Then Range("R8").Select

End Sub
 
Upvote 0
I completely misunderstood your situation from your first post.

MrTeeny seems to be more on track with a solution than my suggestions.

Howard
 
Upvote 0

Forum statistics

Threads
1,216,361
Messages
6,130,180
Members
449,563
Latest member
Suz0718

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