Returns File name or Drive name from given path in one line of code.
Returns File name or Drive name from given path in one line of code.
Rate Returns File name or Drive name from given path in one line of code.
(1(1 Vote))
Dim sParts() As String
sParts = Split("C:\MyWorld\MyStyle\WhoCares\Junk.txt", "\")
'sParts(UBound(sParts)) contains File name 'Junk.txt'
'to check
MsgBox sParts(UBound(sParts))
'Drive name
MsgBox sParts(LBound(sParts))
Returns File name or Drive name from given path in one line of code. Comments
No comments yet — be the first to post one!
Post a Comment