Hello All,
I had the good fortune of getting help on the code below:
The cells look like:
L ABT JNJ 1.417 1.39
So currently if I selected JNJ, R1 becomes JNJ and then in H1 I am using INDEX(MATCH) to look up ABT on another worksheet. The opposite will be true if I select ABT.
I'd like to not have dependency on the other worksheet and if there is more than one instance of either target I believe the INDEX(MATCH) will resolve the first instance (or last?). I am hoping to make Range("H1").Value = Target.Value equal whatever is either to the right or left of the target.
My initial guess is that I need an argument to use the cell to left of the target if the cell to the right of the target is numerical, and the cell to the right of the target if the cell to the right of target is non-numerical.
I don't know how to put this into code since I am a novice here.
Any additional help is much appreciate.
I had the good fortune of getting help on the code below:
PHP:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If IsEmpty(Target.Value) Or IsNumeric(Target.Value) Then Exit Sub
If Not Intersect(Target, Range("3:49")) Is Nothing Then
Range("R1").Value = Target.Value
End If
End Sub
The cells look like:
L ABT JNJ 1.417 1.39
So currently if I selected JNJ, R1 becomes JNJ and then in H1 I am using INDEX(MATCH) to look up ABT on another worksheet. The opposite will be true if I select ABT.
I'd like to not have dependency on the other worksheet and if there is more than one instance of either target I believe the INDEX(MATCH) will resolve the first instance (or last?). I am hoping to make Range("H1").Value = Target.Value equal whatever is either to the right or left of the target.
My initial guess is that I need an argument to use the cell to left of the target if the cell to the right of the target is numerical, and the cell to the right of the target if the cell to the right of target is non-numerical.
I don't know how to put this into code since I am a novice here.
Any additional help is much appreciate.