Find a number in a list.

Matt5353

Board Regular
Joined
Nov 30, 2018
Messages
60
Office Version
  1. 2016
Platform
  1. Windows
I have a list of numbers 0-8200. I can use the find function on the home tab but I wish to have a search box that will highlight the number selected but you have to scroll through the list to find it. Is there a way I can have a search box on my spreadsheet so when I type in the required number it will go straight to the number without scrolling through the long list of numbers?
Andrew
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hmmm, you last image does not show very much.
You may want to practice a little in the "Test Here" forum first, to be sure that you are using it correctly.
 
Upvote 0
Posted my info did you get what you needed
No. All you posted was the blank cell I22 (you can see this, can't you?).
I don't see how is that helpul.
 
Upvote 0
No. All you posted was the blank cell I22 (you can see this, can't you?).
I don't see how is that helpul.
Contact Tracing Passport Use. With Booster.xlsm
ADEFGHIJ
1Totals Main Dining RoomDVNPRBClub No Guest Details DV Documented Use a 0 Under Club No Code i/o
270Kenneth Wood*  1In
3Alan Liddell*  2In
427/01/2022Barry GoodinDV  3In
5Main InMargaret Reid*  4In
670Brian GoodinDV   5In
7Rebecca Weller*  6In
8Emily West*  7In
9Main OutMatthw WarnerDV  8In
10 Bernice Holland*  9In
11Gavin Corboy*  10In
12John EwenDV  11In
13Tab InPeter Frewin*  12In
14 Ian Gilmore*  13In
15Shane Englebretsen*  14In
16Harris Edlin*  15In
17Tab OutIvan TrevathanDV  16In
18 Malcolm YoungDV  17In
19Glenn HoodDV  18In
20Deane CampbellDV  19In
21When you ask a member if they are DV. Input the Data Into the Data Base. Members who have not given details an * will appear. Members Show OnceMary-Ann Helem*  20In
22Eva Barlow*  21In
23Diane EagarDV  22In
24Paul Belcaster*  23In
25Aileen SpargoDV  24In
26Jeffrey Rippey*  25In
27Bev Jeffery*  26In
28Ross Manson*  27In
29Stuart Robb*  28In
30Neville Rau*  29In
31Luka O'Brien*  30In
32Bevin DownieDV  31In
33Alan PlunkettDV  32In
34Christine Roberts*  33In
35Te Poihipi Phillips*  34In
36Helen Watson*  35In
37Garry Pittams*  36In
38Robyn Floyd*  37In
39Deborah HurrenDV  38In
40Graeme Bascand*  39In
41Judith Knapman*  40In
42Kath SimmondsDV  41In
43Robin KingDV  42In
44Sheryl CoyneDV  43In
45Gordon KayDV  44In
46Heather Clark*  45In
47Wayne Gundersen*  46In
48Kirileigh Bennett*  47In
49Billy Waterston*  48In
50Steve HerbisonDV  49In
51Molly ReidDV  50In
52Barry LethbridgeDV  51In
53Denise Moorhouse*  52In
54Heni Zimmermann*  53In
55Clive Woodward*  54In
56Clive Jenkins*  55In
57John Coynedv  56In
58Chris Rapson*  57In
59Carol Hubert*  58In
60Graeme LovellDV  59In
61Rosalie Pattillo*  60In
62William SpencerDV  61In
63Janette ComerDV  62In
64Ross Anderson*  63In
65Kevin WaltersDV  64In
66Brian PorterDV  65In
67Hugh MarstonDV  66In
68Pat Monaghan*  67In
69Mary FletcherDV  68In
70Graham O'donnell*  69In
71Barry Bowden*  70In
24-Jan-22
Cell Formulas
RangeFormula
D2:D71D2=IF(H2<>"",VLOOKUP(H2,'Data Base'!$B$2:$J$8201,4,FALSE),"")
E2:E71E2=IF(H2<>"",VLOOKUP(H2,'Data Base'!$B$2:$J$8201,5,FALSE),"")
F2:F71F2=IF(H2<>"",VLOOKUP(H2,'Data Base'!$B$2:$J$8201,9,FALSE),"")
G2:G71G2=IF(H2<>"",VLOOKUP(H2,'Data Base'!$B$2:$K$8201,10))
A2A2=AB2+AD2
A4A4=IF(H2<>"",IF(B2="",NOW(),B2),"")
A6A6=AB3-A10
A10A10=AB4
A14A14=AD3-A18
A18A18=AD4
J2:J71J2=IF(V2=TRUE,"In",0)
 
Upvote 0
OK, thank you for the data sample.
Now that we have that, can you provide an example of a number you are looking for?

So, if you run my macro, and enter "4", would you want cell H5 (that has the number 4) selected and highlighted?
Is that your expected behavior?
 
Upvote 0
OK, thank you for the data sample.
Now that we have that, can you provide an example of a number you are looking for?

So, if you run my macro, and enter "4", would you want cell H5 (that has the number 4) selected and highlighted?
Is that your expected behavior?
Ys
If I select any number between 1 - 8200 it would select the cell, highlight it, go to the cell without having to scroll to find it.
 
Upvote 0
Ys
If I select any number between 1 - 8200 it would select the cell, highlight it, go to the cell without having to scroll to find it.
OK, that is exactly what the code I gave you will do. I tried it out, entering 67 in the input box that popped up, and it jumped to cell H68 (that contains the value 67) and highlighted it.
So it appears to be doing what you asked.

Did you follow the instuctions I included for how and where it insert the VBA code, and then for how to attach it to a button?
If you do that all correctly, then all you need to do is click the button, and it will prompt you to enter the number, and then when you click OK, it will jump to and highlight that number.

If that is not working for you, please tell us exactly what is happening.
If you get any error messages, please tell us exactly what they are.
 
Upvote 0
I get an error in Search for value

Sub MyFind()

Dim x As Variant
Dim rng As Range

' Prompt user to enter value to look for
x = InputBox("What value do you want to find?")

' Search for value
Set rng = Cells.Find(What:=x, After:=Range("A1"), LookIn:=xlFormulas2, LookAt:= _
xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False)

' Go to range
If rng Is Nothing Then
MsgBox "Cannot find " & x & " on the active sheet", vbOKOnly, "VALUE NOT FOUND!"
Else
' Select range
rng.Select
' Highlight range
rng.Interior.Color = 65535
End If

End Sub
 
Upvote 0
It may be because you are using an older version of Excel than I am.
Try replacing the "xlFormulas2" in that search section with "xlFormulas", and see if that makes any difference.

If it does not, then please do the following:
1. Turn on your Macro Recorder
2. Record yourself hitting CTRL+F on your sheet to bring up the "Find" box, enter the value you are looking for, and hit "Find Next".
3. Stop your Macro Recorder
4. Go into VBA, and copy and paste the code you just recorded here so I can see what it looks like.
 
Upvote 0

Forum statistics

Threads
1,215,544
Messages
6,125,441
Members
449,225
Latest member
mparcado

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