Function to jump to row or something similar

cryss1988

New Member
Joined
May 8, 2024
Messages
6
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
Hi all
Thanks in advance for your help.
I have been trying to find something to help me make my excel spreadsheet work, nut no luck.
So here it is.
I have a list on hundreds of parts, a few columns, like part number, description, infor, and locations.

I'm interested in:
A way of quickly find in that spreadsheet, searching by (partial) description only
get the results and either jump to that row
Or
Load that row completely at the top of the spreadsheet.

So far I managed to use VLookup and Match functions to get it work, but I'm only getting the row number where my part is,
I would like it to jumpnto that row or, like ai said, load the whole row completely
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi welcome, if you have played with Macros, you could use something like this :

VBA Code:
Sub findtest()

Dim ws As Worksheet, Found As Range
Set ws = ActiveWorkbook.ActiveSheet

'searchno = InputBox("Enter your Pat Number:", "Part No:")
'Set Found = ws.Columns(1).Find(what:=searchno, LookIn:=xlValues, lookat:=xlWhole) 'columns(1) = look at col 1 (A)

searchno = InputBox("Enter your Description:", "Description:")
Set Found = ws.Columns(2).Find(what:=searchno, LookIn:=xlValues, lookat:=xlPart)  'columns(2) = look at col. 2 or "B".

If Not Found Is Nothing Then
    Application.Goto Found
End If
End Sub

I included 2 options (one is Greened out by apostrophe at the start) - so you can use either one as you prefer.

One searches for a partial description in column B (assuming Col B is your description), and takes you to the nearest / first row.

The other (greened out) will search for an exact match of part number and take you to the row, assuming Column 1 or ("A") contains part numbers.

cheers
Rob
 
Upvote 0
Thanks
But I'm not fully sure how to make that work.
Can you tell me how to
 
Upvote 0
Sorry, I made it work, it's all fine wirh the pop up box for search...
but there is a small problem,
Can it be a excel field as the source for the search keyword
 
Upvote 0
Hi,

in this case you wouldn't need the input box then I guess. You just point it to the cell ref.

VBA Code:
searchno = InputBox("Enter your Description:", "Description:")

becomes

VBA Code:
searchno = Activesheet.Range("H1")

if your cell was H1

Rgds
Rob
 
Upvote 0
That's perfect thanks a lot!

Can we simplify this a bit, I'm thinking:
After inputing my search termn, is there a function to actually load the entire row with my search results?

I remember using something similar way way back.
 
Upvote 0
not much of a limit with macros ... you just have to apply the logic ..

The danger is though when doing a partial search - that you update the wrong row .. so having eyes on is often a good thing as a sanity check. ?

what is it that gets updated (or why are you searching for the part ?)

cheers
Rob
 
Upvote 0
not much of a limit with macros ... you just have to apply the logic ..

The danger is though when doing a partial search - that you update the wrong row .. so having eyes on is often a good thing as a sanity check. ?

what is it that gets updated (or why are you searching for the part ?)

cheers
Rob
So, the list won't get updated forba long time, and even if it does, will generate a new excel spreadsheet, copy the code or formula on it and it should work :)

So, is there a way of combining match or row functions? Or anything
 
Upvote 0
or to do what you need in Formula (eg. paste row at top of page):

Book1
ABCDEFGHIJ
112364box of egg (12)C40.87
2
312348tin of beansA10.2
412345packet of spamB20.25
512322box of eggs (6)L30.65Search:12364
612364box of egg (12)C40.87
712367can of tunaA51.65
812134packet of corn flakesB61.01
912254box of pastaD40.97
1012222sachet of sauceF90.35
1114321bottle of milkF81.56
1254321carton of creamV41.24
13
Sheet1
Cell Formulas
RangeFormula
A1:D1A1=XLOOKUP(I5,A3:A12,A3:D12,"Not Found",1,1)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,932
Members
449,480
Latest member
yesitisasport

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