Re: Select specific text in cell
- From: "Rick Rothstein \(MVP - VB\)" <rick.newsNO.SPAM@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 16 Feb 2008 10:16:04 -0500
Actually, neither your one liner nor my longer variants will work if filename
includes a "-". For that, we need something like:
==============================
Option Explicit
Function fn(str As String) As String
Dim s1() As String
s1 = Split(str, "\")
s1 = Split(s1(UBound(s1)), "-")
ReDim Preserve s1(UBound(s1) - 1)
fn = Trim(Join(s1, "-"))
End Function
===========================
And, of course, the above would not work if the description itself contained a dash.
Rick
.
- 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: FSt1
- 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
- Prev by Date: Re: Select specific text in cell
- Next by Date: Excel "can't find" double-clicked files
- Previous by thread: Re: Select specific text in cell
- Next by thread: Re: Select specific text in cell
- Index(es):
Relevant Pages
|