# Thread: Extracting specific characters (numbers) within a cell

1. ## Extracting specific characters (numbers) within a cell

I would like to pull out the numbers after the 'SEQ' some are 1 digit and others are more. I highlighted the column with the numbers i would like to extract.

Can this be accomplished??

2. MNN,

Here's a User Defined Function that will do the trick:
Limitation: there must be at least one space on either side of the number!

Code:
```Option Explicit

Function ExtSeqNo(ByVal zText As String) As Long

Dim vParts As Variant

zText = Replace(zText, "  ", " ")
vParts = Split(zText, " ")
ExtSeqNo = vParts(1)

End Function  'ExtSeqNo```
Test Results:
MnnUDF.PNG

HTH

3. Any way of accomplishing this without a MACRO.

Thanks

4. Fill this down (but fix line 17 to remove the add'l space after SEQ so there's only 1 space):

=MID(B3,FIND(" ",B3)+1,FIND(" ",B3,FIND(" ",B3)+1)-FIND(" ",B3))

5. Another formula that will work:

=LEFT(REPLACE(B3,1,4,""),FIND(" ",REPLACE(B3,1,4,""),1)) then copy down. As KW points out, there is an extra space in B17.

Maud

6. As an alternative:
=-LOOKUP(1,-(LEFT(MID(B3,FIND(" ",B3),LEN(B3)),ROW(\$1:\$255))+0))
which works with all your examples.

7. I like all the answers.

Here's my version:
=--MID(B3,4,SEARCH(" ",B3,6)-4)
..then copy down etc etc

zeddy

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•