Thread
:
Extract text between symbols
View Single Post
#
3
Posted to microsoft.public.excel.misc
Don Guillett
external usenet poster
Posts: 10,124
Extract text between symbols
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
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett