Searching for first 3 characters

  • Thread starter Thread starter Melissa
  • Start date Start date
M

Melissa

Hi-

I am trying to search for the first 3 characters of a list of part
numbers. The part numbers I am trying to filter out start with the
same 3 letters, but the next 4 numbers in the part number could be
anything (ex. "ABC1234", "ABC2345").

How can I search the cells for anything containing those first three
letters?

-Melissa
 
Try an AutoFilter:

Select your range of part numbers
(I'm assuming the top cell has a title like: PartNum)

Then...From the Excel Main Menu:
<data><filter><autofilter>
Click on the PartNum heading drop-down
Select: Custom
Settings: Begins with: ABC
Click [OK]

That will hide all PartNum rows where the PartNum does NOT begin with "ABC"

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)
 
You trying to do this with VBA? If so, the code below will filter the
used range where column B starts with ABC.
ActiveSheet.UsedRange.AutoFilter _
Field:=2, Criteria1:="ABC*"
 
Try an AutoFilter:

Select your range of part numbers
(I'm assuming the top cell has a title like: PartNum)

Then...From the Excel Main Menu:
<data><filter><autofilter>
Click on the PartNum heading drop-down
Select: Custom
Settings: Begins with: ABC
Click [OK]

That will hide all PartNum rows where the PartNum does NOT begin with "ABC"

Is that something you can work with?
Post back if you have more questions.
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


I am trying to search for the first 3 characters of a list of part
numbers. The part numbers I am trying to filter out start with the
same 3 letters, but the next 4 numbers in the part number could be
anything (ex. "ABC1234", "ABC2345").
How can I search the cells for anything containing those first three
letters?


Thanks for the quick response.

I do not want to just use a filter because when the program finds the
part number, it grabs all the other part numbers from that sales order
and puts them in another worksheet. Any other suggestions?
 
You trying to do this with VBA? If so, the code below will filter the
used range where column B starts with ABC.
ActiveSheet.UsedRange.AutoFilter _
Field:=2, Criteria1:="ABC*"

I just used this code:

If Cells(r, 2).Value Like "ABC*" Then

It worked. Thanks for your help!
 

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

Back
Top