• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Change cursor to another column after find value

dingdang

Member
I have xls sheet with huge data wherein I am finding some value ( ctr F ) in column E and if value found, inputing sr. no against that value in column I, for that i have to move cursor to I column every time ( right arrow ) which is very time consuming.


is there any option/macro to move cursor automatically to I column after finding the value in E


for exp. if value find in E11 cursor should move to I11.

pls help
 
Maybe something as simple as this.

Paste in the sheet module you are conducting the Find.

Option Explicit

[pre]
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Value = "" Then Exit Sub
If ActiveCell.Column = 5 Then ActiveCell.Offset(0, 4).Select
End Sub
[/pre]
Regards,

Howard
 
Hi ,


Try this :

[pre]
Code:
Public Sub Shift_Cursor_to_Column_I()
Application.Goto ActiveCell.Offset(0, Range("$I:$I").Column - ActiveCell.Column), Scroll:=True
End Sub
[/pre]
Narayan
 
Maybe something as simple as this.

Paste in the sheet module you are conducting the Find.

Option Explicit

[pre]
Code:
Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Value = "" Then Exit Sub
If ActiveCell.Column = 5 Then ActiveCell.Offset(0, 4).Select
End Sub
[/pre]
Regards,

Howard
This is exactly what I need but can't seen to get it to work. I am new to VBA code. I copied this into a VBA module and tried to run it but the name doesn't show up in the list. I have the sheet saved as an .xlsm file and turned on all the macro security settings. Is there something I am missing?
 
This is exactly what I need but can't seen to get it to work. I am new to VBA code. I copied this into a VBA module and tried to run it but the name doesn't show up in the list. I have the sheet saved as an .xlsm file and turned on all the macro security settings. Is there something I am missing?
That is what I did. Opened visual basic under the development tab within the worksheet, inserted a new module 1 and copied the code into it.
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If ActiveCell.Value = "" Then Exit Sub
If ActiveCell.Column = 5 Then ActiveCell.Offset(0, 4).Select
This code belongs in the sheet code not in a module.
Right click on the sheet tab, then paste the code in programmcode....
 
Last edited:
Back
Top