Re: Select specific text in cell
- From: "Rick Rothstein \(MVP - VB\)" <rick.newsNO.SPAM@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 15 Feb 2008 23:00:40 -0500
The above as a "one-liner" in deference to Rick:
LOL
============================================
Function fn(str As String) As String
fn = Trim(Split(Split(str, "\")(UBound(Split _
(str, "\"))), "-")(LBound(Split(Split _
(str, "\")(UBound(Split(str, "\"))), "-"))))
End Function
==========================================
The LBound for a Split is always 0 no matter what the Option Base is set to. Using this fact, your one-liner can be simplified considerably...
Function fn(str As String) As String
fn = Trim(Split(Split(str, "\")(UBound(Split(str, "\"))), "-")(0))
End Function
Rick
.
- Follow-Ups:
- 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: Ron Rosenfeld
- 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
- Prev by Date: Re: In Excel jow do I solve for X in X^1.5?
- Next by Date: Re: In Excel jow do I solve for X in X^1.5?
- Previous by thread: Re: Select specific text in cell
- Next by thread: Re: Select specific text in cell
- Index(es):
Relevant Pages
|
Loading