View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default removing certain text from a string

Sub TTT()
sStr = "xxx-xx-xxx-xxxxxyyyyy-nnnn-nnnn"
v = Split(sStr, "-")
MsgBox v(3)
End Sub

Requires xl2000 or later
--
Regards,
Tom Ogilvy


"Papa Jonah" wrote in message
...
I have a column of report designators that consist of a bunch of text
separated by hyphens
xxx-xx-xxx-xxxxxyyyyy-nnnn-nnnn

I want to end up with the text in the middle to be copied to another

column.
However, I can not (that I am aware of) use the mid function because the
length of the strings between the hyphens can vary.

Any suggestions would be greatly appreciated.
TIA