Re: Select specific text in cell
- From: Ron Rosenfeld <ronrosenfeld@xxxxxxxxxx>
- Date: Sat, 16 Feb 2008 15:43:07 -0500
On Sat, 16 Feb 2008 14:52:16 -0500, "Rick Rothstein \(MVP - VB\)"
<rick.newsNO.SPAM@xxxxxxxxxxxxxxxxxx> wrote:
Expanding -- it would certainly be possible for a parser in which
the "\" preceding the filename was optional
And I meant to my last post that doing this, or any other customization of
parsing, would be fruitless without the OP coming back and filling us in on
what (if any) restrictions exist on his filenames, the descriptions or the
delimiter separating them.
By the way, IF we had to cater to a 'backslashless' path, and IF the
delimiter between the filename and description is in fact a
space/dash/space, the one-liner would become slightly uglier ...
Function fn(str As String) As String
fn = Trim(Split(Split(Replace(str, ":", "\"), "\") _
(UBound(Split(Replace(str, ":", "\"), "\"))), " - ")(0))
End Function
Rick
Well, if the last "-" is the separator between filename and descriptor, and the
"\" is optional, then the regex is simplified:
re.Pattern = "([^\\]*\S)\s?-[^\\]*$"
As a matter of fact, I think the only circumstance that his regex would fail
would be if there were a "-" within the descriptor.
--ron
.
- Follow-Ups:
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- References:
- Re: Select specific text in cell
- From: Ron Rosenfeld
- Re: Select specific text in cell
- From: Ron Rosenfeld
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- From: Ron Rosenfeld
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- From: Ron Rosenfeld
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- From: Rick Rothstein \(MVP - VB\)
- Re: Select specific text in cell
- Prev by Date: Re: modify a standard color like in 2003
- Next by Date: Re: formula for converting military time to standard time, etc
- Previous by thread: Re: Select specific text in cell
- Next by thread: Re: Select specific text in cell
- Index(es):
Relevant Pages
|