ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Searching for first 3 characters (https://www.excelbanter.com/excel-programming/401028-searching-first-3-characters.html)

melissa

Searching for first 3 characters
 
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


Ron Coderre

Searching for first 3 characters
 
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)

"Melissa" wrote in message
ups.com...
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





JW[_2_]

Searching for first 3 characters
 
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*"

Melissa wrote:
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



melissa

Searching for first 3 characters
 
On Nov 13, 10:37 am, "Ron Coderre"
wrote:
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)

"Melissa" wrote in message

ups.com...

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



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?


melissa

Searching for first 3 characters
 
On Nov 13, 10:42 am, JW wrote:
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*"

Melissa wrote:
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


I just used this code:

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

It worked. Thanks for your help!



All times are GMT +1. The time now is 12:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com