tring to add a search cell

jamtay317

Well-known Member
Joined
Mar 6, 2013
Messages
769
I have a data base that I want to search where if I type Sm* it will bring up all of the last names that start with Sm. also useing the same cell I would like to be able to search lot numbers and sales order numbers. I have a data set, please tell me what or where I need to add for someone can help me with the VBA code.
 
ok, I would say that if there is a number look up, like sales order number, then yes it could be in the address portion of the row, but if I'm looking up "man" that would just be under the last name

also, there is about 2000 records in this data that is the reason that there isnt a "man" in the data set that you saw.

Please just try to give an example to look up, appropriate to the sample posted.
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
ok if I type "Summerset" it will bring up all of the Summerset Jobs, if I type "13" it will bring up all the records that SaleOrderNumber start with 13
 
Upvote 0
Hi,

I'm not sure that I fully understand this, but here goes my attempt...

Limited Sample Data....

Excel Workbook
CDEFGHIJKLMNOPQ
3
4SOrderNumberinvoiceNumberDateBilling NumberLastFirstAddressSq FootageFlooring TypeGroutColorTotalCityState
51360613818Hampton020902 Freemont Moore Road20Builder backsplash diagonal$300.00WestfieldIN
61358613824LoyalJoyce3617 Tiara Ct00$45.00IndianapolisIN
71375013825ArchieBetsy10923 firefly Ct00$160.00IndianapolisIN
81387313871Sumerset5811624 Cannington Cir00$130.00FishersIN
91337813858Place4 Stafford14534 Alderbrook Trail1Builder fireplace$95.00CarmelIN
1013682-013857Brookheaven1022708 Benmore Ct505Builder straight$2,144.00ZionsvilleIN
111332013738BuildersShamrock9800 Westpoint Dr0none$277.00IndianapolisIN
121350613977lakeside21313995 amblewind place24.5Builder backsplash straight$294.00carmelIN
131394113949BashamVirginnia5801 Lawton Loop E. Dr Unit 5264Retail full spread$205.92IndianapolisIN
1413682-113857Brookheaven1022708 Benmore Ct90Builder diagonal$698.00ZionsvilleIN
15
ExDrexelInvoices


Example Results (SOrderNumber) based on the above Limited Sample Data....

Excel Workbook
CDEFGHIJKLMNOPQRS
1CriteriaSearchCount10
2SOrderNumberSOrderNumber
3Last13
4Flooring_TypeSOrderNumberinvoiceNumberDateBilling NumberLastFirstAddressSq FootageFlooring TypeGroutColorTotalCityState
5136061381800Hampton020902 Freemont Moore Road20Builder backsplash diagonal0$300.00WestfieldIN
6135861382400LoyalJoyce3617 Tiara Ct000$45.00IndianapolisIN
7137501382500ArchieBetsy10923 firefly Ct000$160.00IndianapolisIN
8138731387100Sumerset5811624 Cannington Cir000$130.00FishersIN
9133781385800Place4 Stafford14534 Alderbrook Trail1Builder fireplace0$95.00CarmelIN
1013682-01385700Brookheaven1022708 Benmore Ct505Builder straight0$2,144.00ZionsvilleIN
11133201373800BuildersShamrock9800 Westpoint Dr0none0$277.00IndianapolisIN
12135061397700lakeside21313995 amblewind place24.5Builder backsplash straight0$294.00carmelIN
13139411394900BashamVirginnia5801 Lawton Loop E. Dr Unit 5264Retail full spread0$205.92IndianapolisIN
1413682-11385700Brookheaven1022708 Benmore Ct90Builder diagonal0$698.00ZionsvilleIN
15
16
Sheet2


Example2 (Last)....

Excel Workbook
CDEFGHIJKLMNOPQRS
1CriteriaSearchCount4
2SOrderNumberLast
3LastB
4Flooring_TypeSOrderNumberinvoiceNumberDateBilling NumberLastFirstAddressSq FootageFlooring TypeGroutColorTotalCityState
513682-01385700Brookheaven1022708 Benmore Ct505Builder straight0$2,144.00ZionsvilleIN
6133201373800BuildersShamrock9800 Westpoint Dr0none0$277.00IndianapolisIN
7139411394900BashamVirginnia5801 Lawton Loop E. Dr Unit 5264Retail full spread0$205.92IndianapolisIN
813682-11385700Brookheaven1022708 Benmore Ct90Builder diagonal0$698.00ZionsvilleIN
9
10
11
12
13
14
15
16
Sheet2


Example3 (Flooring_Type).....

Excel Workbook
CDEFGHIJKLMNOPQRS
1CriteriaSearchCount5
2SOrderNumberFlooring_Type
3LastBui
4Flooring_TypeSOrderNumberinvoiceNumberDateBilling NumberLastFirstAddressSq FootageFlooring TypeGroutColorTotalCityState
5136061381800Hampton020902 Freemont Moore Road20Builder backsplash diagonal0$300.00WestfieldIN
6133781385800Place4 Stafford14534 Alderbrook Trail1Builder fireplace0$95.00CarmelIN
713682-01385700Brookheaven1022708 Benmore Ct505Builder straight0$2,144.00ZionsvilleIN
8135061397700lakeside21313995 amblewind place24.5Builder backsplash straight0$294.00carmelIN
913682-11385700Brookheaven1022708 Benmore Ct90Builder diagonal0$698.00ZionsvilleIN
10
11
12
13
14
15
16
Sheet2



Is that doing what you require?

Ak
 
Upvote 0
Hi,

I don't understand!!

The above shows the following results...
Searching for "SOrderNumber" 13 (returning every record starting with 13)
Searching for "Last" B (returning every record starting with B)
Searching for "Flooring_Type" (returning every record starting with Bui)

What do you mean that it just shows a blank?

Ak
 
Upvote 0
Hi,

I think I understand now what you mean by, it just shows a blank.

Have you tried to use the formula above in your worksheet?
If so, it wont work until I tell you how!
I didn't want to go into a long explanation if the Example Results were not what you would expect.
So can you let me know if Post #23 is correct or not?

Ak
 
Upvote 0
ok if I type "Summerset" it will bring up all of the Summerset Jobs, if I type "13" it will bring up all the records that SaleOrderNumber start with 13

Sheet1, A:M, contains the data.

Sheet2, A:N, contains the processing (here shown in part)...

SOrderNumberLastFlooring_Type
backsplash
IdxSOrderNumberinvoiceNumberDateBilling NumberLast
1136061381800Hampton
8135061397700lakeside

<colgroup><col style="width: 103pt; mso-width-source: userset; mso-width-alt: 4892;" width="138"> <col style="width: 134pt; mso-width-source: userset; mso-width-alt: 6343;" width="178"> <col style="width: 132pt; mso-width-source: userset; mso-width-alt: 6257;" width="176"> <col style="width: 122pt; mso-width-source: userset; mso-width-alt: 5774;" width="162"> <col style="width: 131pt; mso-width-source: userset; mso-width-alt: 6200;" width="174"> <col style="width: 127pt; mso-width-source: userset; mso-width-alt: 6001;" width="169"> <tbody>
</tbody>

A1:C1 houses criteria headers.
A2:C2 can be filled in partially; here just a substring as criterion value for Flooring_Type.

A4, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(SMALL(IF(ISNUMBER(SEARCH("*"&$A$2&"|*"&"*"&$B$2&"|*"&"*"&$C$2&"*",
  Sheet1!$A$2:$A$11&"|"&Sheet1!$E$2:$E$11&"|"&Sheet1!$I$2:$I$11)),
  ROW(Sheet1!$A$2:$A$11)-ROW(Sheet1!$A$2)+1),ROWS($A$4:A4)),"")

B4, just enter, copy across as far as needed, and copy down:
Rich (BB code):
=IF($A4="","",INDEX(Sheet1!$A$2:$M$11,$A4,COLUMNS($B$2:B2)))
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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