Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I would like to extract text from a string which will contain:
<sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
With text in cel A1
Try something like this: B1: =LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1) Does that help? *********** Regards, Ron XL2002, WinXP "billinr" wrote: I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
try this
Sub extracttext() For Each c In Selection fb = InStr(1, c, "/") + 1 'MsgBox fb sb = InStr(fb + 1, c, "/") 'MsgBox sb ms = Mid(c, fb, sb - fb) MsgBox ms rest = Right(c, Len(c) - sb) MsgBox rest Next c End Sub -- Don Guillett SalesAid Software "billinr" wrote in message ... I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mon, 30 Apr 2007 12:12:01 -0700, billinr
wrote: I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks If the strings are less than 256 characters long, then you could download and install Longre's free (and easily distributable) morefunc.xll add-in from http://xcell05.free.fr/. Then use this formula: =REGEX.MID(A1,"(?<=/).*?(?=/)") --ron |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mon, 30 Apr 2007 15:59:04 -0400, Ron Rosenfeld
wrote: On Mon, 30 Apr 2007 12:12:01 -0700, billinr wrote: I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks If the strings are less than 256 characters long, then you could download and install Longre's free (and easily distributable) morefunc.xll add-in from http://xcell05.free.fr/. Then use this formula: =REGEX.MID(A1,"(?<=/).*?(?=/)") --ron Oh, for the text after the second "/" =REGEX.SUBSTITUTE(A1,".*/.*/") --ron |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you. This worked well for the text between the symbols.
Could you offer something that would find the text after the second "/"? TIA "Ron Coderre" wrote: With text in cel A1 Try something like this: B1: =LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1) Does that help? *********** Regards, Ron XL2002, WinXP "billinr" wrote: I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks |
#7
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try this:
=MID(A1,FIND("/",A1,FIND("/",A1)+1)+1,255) Biff "billinr" wrote in message ... Thank you. This worked well for the text between the symbols. Could you offer something that would find the text after the second "/"? TIA "Ron Coderre" wrote: With text in cel A1 Try something like this: B1: =LEFT(MID(A1,FIND("/",A1)+1,255),FIND("/",MID(A1,FIND("/",A1)+1,255))-1) Does that help? *********** Regards, Ron XL2002, WinXP "billinr" wrote: I would like to extract text from a string which will contain: <sometext/the text I want/<sometext The beginning and ending text will vary in length, but the text I want will be between the two "/". I am also looking to extract the text after the second "/", in a different operation. The data will change, so I want to write this as a template. Any help is appreciated. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I get # symbols in my cell instead of text | Excel Discussion (Misc queries) | |||
Why does text in a cell appear as a line of '#' symbols? | Excel Discussion (Misc queries) | |||
how to remove symbols ahead of text and numbers copied from web | Excel Worksheet Functions | |||
Text & symbols in the same drop-down list | Excel Discussion (Misc queries) | |||
EXTRACT TEXT FROM TEXT STRING | Excel Worksheet Functions |