How to Make Excel Move Automatically to the Defined cell position

pankajgrover

Board Regular
Joined
Oct 27, 2022
Messages
99
Office Version
  1. 365
Platform
  1. Windows
Here is example. I want if i input value "S" only in F3 cell, then automatically excel or cursor move to M3 cell. It should happens only when "S" type otherwise normal default move. How to do that, Thanks.

Shares Trading.xlsx
AEFGHIJKLM
2NamePartnersB/SDateQtyPriceAmountS.NameS.PartnersS.Date
3SilverPankajS SilverPankaj
Sheet1
Cell Formulas
RangeFormula
J3J3=((H3*B3)*I3)
K3K3=Sheet1!$A3
L3L3=[@Partners]
Cells with Data Validation
CellAllowCriteria
A3:A86List=Shares
E3:E86List=Partners
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
You will need VBA code to do this.

Right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the resulting VB Editor window:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.CountLarge > 1 Then Exit Sub
   
'   If "S" is entered in column F, jump to column M
    If Target.Column = 6 And Target.Value = "S" Then
        Target.Offset(0, 7).Select
    End If
   
End Sub
Then any time you enter "S" in a cell in column F, you cursor will jump to column M of the same row.
 
Upvote 0
Solution
You will need VBA code to do this.

Right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the resulting VB Editor window:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.CountLarge > 1 Then Exit Sub
  
'   If "S" is entered in column F, jump to column M
    If Target.Column = 6 And Target.Value = "S" Then
        Target.Offset(0, 7).Select
    End If
  
End Sub
Then any time you enter "S" in a cell in column F, you cursor will jump to column M of the same row.
Wow Thanks Working. Also pls guide me i am doing some stocks closing price work. I want if i run or hit any key or any code macro then copy certain cells value to another cells. here is example below . i want when run code then copy AJ Cells to AN only values by hit any key or code otherwise not copy .. How to do that this Thanks

Shares Trading.xlsm
AJAN
356324.0056324.00
469427.0069427.00
5459.65449.60
62446.952448.33
769427.0069069.00
Vishal
Cell Formulas
RangeFormula
AJ3:AJ7AJ3=D3
AN7AN7=IF($AK7="","",IF($AK7="B",I7,P7))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AL3:AN30Expression=$AK3="S"textNO
AL3:AN30Expression=$AK3="B"textNO
 
Upvote 0
Wow Thanks Working. Also pls guide me i am doing some stocks closing price work. I want if i run or hit any key or any code macro then copy certain cells value to another cells. here is example below . i want when run code then copy AJ Cells to AN only values by hit any key or code otherwise not copy .. How to do that this Thanks

Shares Trading.xlsm
AJAN
356324.0056324.00
469427.0069427.00
5459.65449.60
62446.952448.33
769427.0069069.00
Vishal
Cell Formulas
RangeFormula
AJ3:AJ7AJ3=D3
AN7AN7=IF($AK7="","",IF($AK7="B",I7,P7))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AL3:AN30Expression=$AK3="S"textNO
AL3:AN30Expression=$AK3="B"textNO
You are welcome.
That is a whole new and different question, and should therefore be posted in a new thread.
 
Upvote 0
You are welcome.
That is a whole new and different question, and should therefore be posted in a new thread.
okay. I do in new thread, can i convert this post also to in new thread from here?
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,962
Latest member
Fenes

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