Excel JUMP FROM SEARCH BAR TO RESULT


Joined
Nov 12, 2019
Messages
3
Reaction score
1
HI THERE
IS THERE A WAY I CAN JUMP FROM THE SEARCH CELL TO THE RESULT OF THAT SPECIFIC SEARCH? ALL THE SEARCH CELL DOES IS HIGHLIGHT THE RESULT IN THE RANGE I HAVE NAMED AND FORMATTED(CONDITIONAL) FOR THIS.

FOR EXAMPLE:
NAMED RANGE = A2 TO C10 (DATA IN CELLS ARE NUMBERS 1 - 30)
SEARCH CELL = E1
IF I TYPE "17" IN TO SEARCH CELL(E1) AND PRESS ENTER, IT HIGHLIGHTS B7(17). INSTEAD OF DONG THIS I WANT IT TO JUMP FROM THE SEARCH BAR TO B7 WHEN I PRESS INTER. BASICALLY I WANT IT TO JUMP TO THE CELL THAT I SEARCH FOR NOT JUST HIGHLIGHT IT.
 
Ad

Advertisements

Joined
Feb 21, 2018
Messages
209
Reaction score
83
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$1" Then
srch = Format(Target, "0")
Columns("A:C").Select
Selection.Find(What:=srch, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

ActiveCell.Offset(0, 0).Select
End If
End Sub

Attached is an excel file which I tested the code with.
 

Attachments

Joined
Nov 12, 2019
Messages
3
Reaction score
1
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$E$1" Then
srch = Format(Target, "0")
Columns("A:C").Select
Selection.Find(What:=srch, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate

ActiveCell.Offset(0, 0).Select
End If
End Sub

Attached is an excel file which I tested the code with.
THANKS A MILLION
WHERE DO I WRITE THIS CODE?
STILL LEARNING LOL
 
Ad

Advertisements

Joined
Feb 21, 2018
Messages
209
Reaction score
83
Right click on the sheet tab (probably in the bottom left of the screen)
A menu would popup

From that menu choose View Code

This will bring a white vba code area

Paste the code there.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top