Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract specific string

Hi all,
I need extract a specific string and my cells may contains many alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN is 9 all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Extract specific string

I think you may have to tell us more about what you are trying to do and
what you have to work with. First, I'm assuming each item in the list you
showed is on a separate row. Do the strings you are trying to extract always
start with a single letter? If yes, I'm guessing it is not always an "S", is
it? Again, if so, then will only digits follow it? In other words, are you
looking for a single letter followed by eight digits? After you answer the
above questions, here is the most important question... where did you want
these values "extracted" to? An array in VB code? Another column? Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN is 9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract specific string

The string start always with "S" and finished with 8 digits and a VB function
will be help me so much.
Thanks

Dante



"Rick Rothstein" wrote:

I think you may have to tell us more about what you are trying to do and
what you have to work with. First, I'm assuming each item in the list you
showed is on a separate row. Do the strings you are trying to extract always
start with a single letter? If yes, I'm guessing it is not always an "S", is
it? Again, if so, then will only digits follow it? In other words, are you
looking for a single letter followed by eight digits? After you answer the
above questions, here is the most important question... where did you want
these values "extracted" to? An array in VB code? Another column? Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN is 9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Extract specific string

Unfortunately, you didn't answer all the questions I asked, so I am still
not sure how to reply to you. Are the items you showed in your list in a
column, one item per row? Where do you want the extracted strings to go...
an array inside of VB code, another column or somewhere else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
The string start always with "S" and finished with 8 digits and a VB
function
will be help me so much.
Thanks

Dante



"Rick Rothstein" wrote:

I think you may have to tell us more about what you are trying to do and
what you have to work with. First, I'm assuming each item in the list you
showed is on a separate row. Do the strings you are trying to extract
always
start with a single letter? If yes, I'm guessing it is not always an "S",
is
it? Again, if so, then will only digits follow it? In other words, are
you
looking for a single letter followed by eight digits? After you answer
the
above questions, here is the most important question... where did you
want
these values "extracted" to? An array in VB code? Another column?
Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN is
9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante


.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract specific string


- Are the items you showed in your list in a
column, one item per row?
Yes
- Where do you want the extracted strings to go...
an array inside of VB code, another column or somewhere else?
Basically I need a VB function, for example:
if I have in colunmn A a row S00256325 with the function extract this in
column B
any other alphanumeric data column B is blank
ColumnA ColumnB I see
S00256325 =Myextractfunction(A2) S00256325
AnyotherData =Myextractfunction(A2) Blank

Thanks so much for your time!

Dante






"Rick Rothstein" wrote:

Unfortunately, you didn't answer all the questions I asked, so I am still
not sure how to reply to you. Are the items you showed in your list in a
column, one item per row? Where do you want the extracted strings to go...
an array inside of VB code, another column or somewhere else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
The string start always with "S" and finished with 8 digits and a VB
function
will be help me so much.
Thanks

Dante



"Rick Rothstein" wrote:

I think you may have to tell us more about what you are trying to do and
what you have to work with. First, I'm assuming each item in the list you
showed is on a separate row. Do the strings you are trying to extract
always
start with a single letter? If yes, I'm guessing it is not always an "S",
is
it? Again, if so, then will only digits follow it? In other words, are
you
looking for a single letter followed by eight digits? After you answer
the
above questions, here is the most important question... where did you
want
these values "extracted" to? An array in VB code? Another column?
Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN is
9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante

.


.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Extract specific string

Assuming your data starts in A2 (with A1 being a header), put this formula
in B2 and copy it down as far as you need to...

=IF(AND(LEN(A2)=9,LEFT(A2)="S",ISNUMBER(--MID(A2,2,8))),A2,"")

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...

- Are the items you showed in your list in a
column, one item per row?
Yes
- Where do you want the extracted strings to go...
an array inside of VB code, another column or somewhere else?
Basically I need a VB function, for example:
if I have in colunmn A a row S00256325 with the function extract this in
column B
any other alphanumeric data column B is blank
ColumnA ColumnB I see
S00256325 =Myextractfunction(A2) S00256325
AnyotherData =Myextractfunction(A2) Blank

Thanks so much for your time!

Dante






"Rick Rothstein" wrote:

Unfortunately, you didn't answer all the questions I asked, so I am still
not sure how to reply to you. Are the items you showed in your list in a
column, one item per row? Where do you want the extracted strings to
go...
an array inside of VB code, another column or somewhere else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
The string start always with "S" and finished with 8 digits and a VB
function
will be help me so much.
Thanks

Dante



"Rick Rothstein" wrote:

I think you may have to tell us more about what you are trying to do
and
what you have to work with. First, I'm assuming each item in the list
you
showed is on a separate row. Do the strings you are trying to extract
always
start with a single letter? If yes, I'm guessing it is not always an
"S",
is
it? Again, if so, then will only digits follow it? In other words, are
you
looking for a single letter followed by eight digits? After you answer
the
above questions, here is the most important question... where did you
want
these values "extracted" to? An array in VB code? Another column?
Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in
message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN
is
9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante

.


.


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Extract specific string

Thanks for your help, very appreciated!

"Rick Rothstein" wrote:

Assuming your data starts in A2 (with A1 being a header), put this formula
in B2 and copy it down as far as you need to...

=IF(AND(LEN(A2)=9,LEFT(A2)="S",ISNUMBER(--MID(A2,2,8))),A2,"")

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...

- Are the items you showed in your list in a
column, one item per row?
Yes
- Where do you want the extracted strings to go...
an array inside of VB code, another column or somewhere else?
Basically I need a VB function, for example:
if I have in colunmn A a row S00256325 with the function extract this in
column B
any other alphanumeric data column B is blank
ColumnA ColumnB I see
S00256325 =Myextractfunction(A2) S00256325
AnyotherData =Myextractfunction(A2) Blank

Thanks so much for your time!

Dante






"Rick Rothstein" wrote:

Unfortunately, you didn't answer all the questions I asked, so I am still
not sure how to reply to you. Are the items you showed in your list in a
column, one item per row? Where do you want the extracted strings to
go...
an array inside of VB code, another column or somewhere else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in message
...
The string start always with "S" and finished with 8 digits and a VB
function
will be help me so much.
Thanks

Dante



"Rick Rothstein" wrote:

I think you may have to tell us more about what you are trying to do
and
what you have to work with. First, I'm assuming each item in the list
you
showed is on a separate row. Do the strings you are trying to extract
always
start with a single letter? If yes, I'm guessing it is not always an
"S",
is
it? Again, if so, then will only digits follow it? In other words, are
you
looking for a single letter followed by eight digits? After you answer
the
above questions, here is the most important question... where did you
want
these values "extracted" to? An array in VB code? Another column?
Somewhere
else?

--
Rick (MVP - Excel)


"Dante Huapaya" wrote in
message
...
Hi all,
I need extract a specific string and my cells may contains many
alphanumeric
data
In this example I need Extract only S00059997 and S00075671 the LEN
is
9
all
the time.
Thanks for your Help

Data_Account
----------------
ANY-NOTES
ANY---NAMES
S00059997
ANY-NOTES
S00075671

Dante

.


.


.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to extract specific text from a string of characters rushdhih Excel Worksheet Functions 7 February 19th 09 09:58 AM
Extract string after specific characters [email protected] Excel Programming 7 July 11th 07 12:51 PM
Formula to extract a specific word from text string Dinesh Excel Worksheet Functions 4 November 3rd 06 08:35 PM
Extract specific value from a long text string Dinesh Excel Worksheet Functions 4 August 11th 06 04:24 AM
extract string owl527[_7_] Excel Programming 3 November 4th 05 10:35 AM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"