blah\blah1\blah2\blah3
would return:
blah3
How would I go about doing this?
Thanks, in advance for the help,
tim
=RIGHT(A1,LEN(A1)-FIND("*",SUBSTITUTE(A1,"\","*",LEN(A1)-LEN(SUBSTITUTE(A1,"\","")))))
--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP
----------------------------------------------------------------------------
There's no 'I' in 'Team'
----------------------------------------------------------------------------
"Tim Otero" <timo...@msn.com> wrote in message news:#ENeIf2O...@TK2MSFTNGP11.phx.gbl...
MsgBox Mid("blah\blah1\blah2\blah3", InStrRev("blah\blah1\blah2\blah3",
"\") + 1)
"Tim Otero" <timo...@msn.com> wrote in message
news:%23ENeIf2...@TK2MSFTNGP11.phx.gbl...
I guess I should have mentioned I need it in VBA. I took a look at Bob's
code, but that won't work because I'm getting a path (only path) from the
user through the use of the Windows Shell Browse For Folder (thank you Jim
Rech). I'd like to display the path in one location and the folder name in
another.
tim
"Ken Wright" <ken.w...@NOSPAMntlworld.com> wrote in message
news:Ow6IHj2O...@TK2MSFTNGP11.phx.gbl...
tim
"Tim Otero" <timo...@msn.com> wrote in message
news:#Yni5q2O...@tk2msftngp13.phx.gbl...
tim
"Bob Kilmer" <rpr...@yahoo.com> wrote in message
news:u7BbEl2O...@tk2msftngp13.phx.gbl...
http://support.microsoft.com/default.aspx?scid=kb;en-us;188007
In article <#Yni5q2O...@tk2msftngp13.phx.gbl>,
Bob Kilmer
"Tim Otero" <timo...@msn.com> wrote in message
news:eiKLX82O...@TK2MSFTNGP11.phx.gbl...
Thanks again,
tim
"Bob Kilmer" <rpr...@yahoo.com> wrote in message
news:uexG0T3O...@TK2MSFTNGP10.phx.gbl...
> I guess I should have mentioned I need it in VBA.
No you shouldn't - I should have twigged from which groups it was posted in. Been pretty brain
dead these last 3/4 weeks working a couple of big proposals, so I'm not really firing on all
cylinders at the moment - apologies.
--
Regards
Ken....................... Microsoft MVP - Excel
Sys Spec - Win XP Pro / XL2K & XLXP
----------------------------------------------------------------------------
There's no 'I' in 'Team'
----------------------------------------------------------------------------
"Tim Otero" <timo...@msn.com> wrote in message news:#Yni5q2O...@tk2msftngp13.phx.gbl...
Sub Hmmmm()
Dim v As Variant
v = Split("blah\blah1\blah2\blah3", "\")
MsgBox v(UBound(v))
End Sub
"Tim Otero" <timo...@msn.com> wrote in message
news:%23ENeIf2...@TK2MSFTNGP11.phx.gbl...
Thanks for the info
This is fun stuff
tim
"Bob Kilmer" <rpr...@yahoo.com> wrote in message
news:OIgUu$CPDHA...@TK2MSFTNGP11.phx.gbl...
Msgbox Split("blah\blah1\blah2\blah3","\")(3)
Could also write
s = "blah\blah1\blah2\blah3"
Msgbox Split(s,"\")(Ubound(Split(s,"\")))
, to retun the last item, but now we're really getting carried away! <g>
Bob
"Tim Otero" <timo...@msn.com> wrote in message
news:OsaoaMDP...@TK2MSFTNGP11.phx.gbl...
One last question, if I may. I understand your explanation, I'm just
confused as to what function the initial v performs.
Ubound(v) returns 3
v(Ubound(v)) returns Blah3
which is what I wanted. Is this just one of those things, or is there a good
reason this works?
tim
"Bob Kilmer" <rpr...@yahoo.com> wrote in message
news:#gkkK0PP...@tk2msftngp13.phx.gbl...
You can define arrays of various types. The following is a more typical way
to declare and use arrays in VB. They are often, perhaps usually, populated
in a loop of some kind because they can be quite large or because it just
makes sense to do so in context, rather than by explicit assignment as
below. Often you are collecting things together that make sense as a group
and you want easy access to (by index) later. You can create
multi-dimensional arrays as well. You can think of a two dimensional array
as you might a spreadsheet - that is as having rows and columns.
Sub test()
Dim myArray(0 To 2) As Long
myArray(0) = 1000
myArray(1) = 2000
myArray(2) = 3000
Msgbox CStr(myArray(2))
Dim Pets(0 To 2) As String
Dim i as Integer
Pets(0) = "Cat"
Pets(1) = "Dog"
Pets(2) = "Fish"
For i = LBound(Pets) To UBound(Pets)
Msgbox myArray(2)
Next i
End Sub
Bob
"Tim Otero" <timo...@msn.com> wrote in message
news:ePmKDEQ...@TK2MSFTNGP10.phx.gbl...
tim
"Bob Kilmer" <rpr...@yahoo.com> wrote in message
news:#Dzn6vQP...@TK2MSFTNGP11.phx.gbl...