How to Move mouse cursor to specific next cell/Column based on a cell Value

azad092

Board Regular
Joined
Dec 31, 2019
Messages
198
Office Version
  1. 2007
Platform
  1. Windows
Hi
good morning all members
I want that when I enter a specific word in a cell the mouse cursor should be move to next specific cell or column that i want
for example if I enter the word "Call Back" in cell G2 the mouse cursor should move to the B3 of next row similarly if i enter the word "Ok" in G2 then the mouse cursor should move to the O2
how it can possible please guide me
 
As the code is exactly what I posted before, did you work out why it wasn't working for you before ? Did you have the code in the wrong place?

"<>"
yes I put the code in the wrong place.....
but now an other issue is occurring when I edit the code and change the conditional word like as instead of call back or OK I type an other word the code does not work
and also guide me how use the "<>" operator I add this operator like as
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row = 1 Then Exit Sub
If Target.Column = 21 And LCase(Target.Value) = "call back" Then Cells(Target.Row + 1, "D").Select
If Target.Column = 7 And LCase(Target.Value) <> "OK" Then Cells(Target.Row, "L").Select
End Sub
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
The code converts the cell value to lower case LCase(Target.Value) to compare it so you need to use lower case in the code as I did. So use "ok" not "OK"
The conversion to a particular case is so that these all work "OK", "Ok", "oK" or "ok"
You have used the "<>" operator correctly.
 
Upvote 0
The code converts the cell value to lower case LCase(Target.Value) to compare it so you need to use lower case in the code as I did. So use "ok" not "OK"
The conversion to a particular case is so that these all work "OK", "Ok", "oK" or "ok"
You have used the "<>" operator correctly.
peter you are great work
just a little help more
I am already using the change event and I want to add this piece of in the given change event coding
I have tried myself but its not working please make the correction

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String
Application.EnableEvents = True
On Error GoTo Exitsub
If Target.Column = 63 Or Target.Column = 70 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue

If Target.CountLarge > 1 Or Target.Row = 1 Then Exit Sub
If Target.Column = 21 And LCase(Target.Value) = "call back" Then Cells(Target.Row + 1, "D").Select
If Target.Column = 7 And LCase(Target.Value) = "ok" Then Cells(Target.Row, "L").Select
End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True

End Sub
 
Upvote 0
Two things:
  1. When posting code please use code tags to preserve the indentation of the code. It is much harder to read/debug code that is all left-aligned. My signature block below has help about this.

  2. You have said that your code is not working but if I do not know what it is supposed to do, how can I offer advice about any correction? ;)
 
Upvote 0
Two things:
  1. When posting code please use code tags to preserve the indentation of the code. It is much harder to read/debug code that is all left-aligned. My signature block below has help about this.

  2. You have said that your code is not working but if I do not know what it is supposed to do, how can I offer advice about any correction? ;)
I mean that if I use only that code then it works fine but as I add this piece of coding into another coding that have worksheet change event then it not work please see the complete coding that I send you
 
Upvote 0
another coding that i am using on worksheet change event
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String

On Error GoTo Exitsub

If Not Intersect(Target, Range("E:E,L:L,V:V,AH:AH,AI:AI,AJ:AJ,AX:AX")) Is Nothing Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Proper(Target.Value)
End If

Application.EnableEvents = True
If Target.Column = 63 Or Target.Column = 70 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue

End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
.......................
and on the same event the code that you have suggested
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row = 1 Then Exit Sub
If Target.Column = 21 And LCase(Target.Value) = "call back" Then Cells(Target.Row + 1, "D").Select
If Target.Column = 7 And LCase(Target.Value) <> "fire case" Then Cells(Target.Row, "L").Select
End Sub
 
Upvote 0
You still haven't put your code in code tags or explained what your code is supposed to do.
 
Upvote 0
VBA Code:
another coding that i am using on worksheet change event
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Oldvalue As String
Dim Newvalue As String

On Error GoTo Exitsub

If Not Intersect(Target, Range("E:E,L:L,V:V,AH:AH,AI:AI,AJ:AJ,AX:AX")) Is Nothing Then
Application.EnableEvents = False
Target.Value = WorksheetFunction.Proper(Target.Value)
End If

Application.EnableEvents = True
If Target.Column = 63 Or Target.Column = 70 Then
If Target.SpecialCells(xlCellTypeAllValidation) Is Nothing Then
GoTo Exitsub
Else: If Target.Value = "" Then GoTo Exitsub Else
Application.EnableEvents = False
Newvalue = Target.Value
Application.Undo
Oldvalue = Target.Value
If Oldvalue = "" Then
Target.Value = Newvalue
Else
If InStr(1, Oldvalue, Newvalue) = 0 Then
Target.Value = Oldvalue & ", " & Newvalue
Else:
Target.Value = Oldvalue

End If
End If
End If
End If
Application.EnableEvents = True
Exitsub:
Application.EnableEvents = True
End Sub
.......................
and on the same event the code that you have suggested
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.CountLarge > 1 Or Target.Row = 1 Then Exit Sub
If Target.Column = 21 And LCase(Target.Value) = "call back" Then Cells(Target.Row + 1, "D").Select
If Target.Column = 7 And LCase(Target.Value) <> "fire case" Then Cells(Target.Row, "L").Select
End Sub

code snap.jpeg
 
Upvote 0
You have to put your code between the code tags, not after them.
I still don't know what your code is supposed to do.
 
Upvote 0

Forum statistics

Threads
1,215,237
Messages
6,123,805
Members
449,127
Latest member
Cyko

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