Complicated search

Craig1

Active Member
Joined
Jun 11, 2009
Messages
322
Hi Guys,

I need to carry out a search in column H. In H8 I want to input a criteria and have an auto filter that will filter the info I input
The problem is the column is populated with machinary parts numbers, something like GBQ2-LP04-00358-358RE401. This number cannot be remembered very easily so most people remember the last set of numbers / letters.
Using a command button I would like to search for the last 8 (in this case) letters / numbers so it would be 358RE401.
Then a problem arises because the next search I need to do may be GBQ2-GP04-0G405-304FBD461 which is now 9 letters or numbers.
It may simplify it by counting the 304FBD461 that I enter in H8 and then bring all the GBQ2-GP04-0G405-304FBD461 in the auto filter by me just entering 304FBD461.

Not sure I have explained this 100%, so any help / questions would be appreciated.

Craig.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
May I suggest a workaround here?

The following should return the last grouping of numbers(assuming that they are already delimited by "-")

=RIGHT(A1,LEN(A1)-SEARCH("@",SUBSTITUTE(A1,"-","@",LEN(A1)-LEN(SUBSTITUTE(A1,"-","")))))

Then you can copy that formula downwards and filter by the new column.

Then it looks as though you are looking for a macro to actually perform the filter - Note - untested code --

Code:
.AutoFilterMode = False

            .Range("A9:I100").AutoFilter

            .Range("A9:I100").AutoFilter Field:=9, Criteria1:=Range("H8").Value

I am assuming the search field is in H8 and the previously provided column is in column I - you will have to adjust the range to be filtered(currently A9:I100) and most likely assign a shortcut etc.

Cheers, :)
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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