Aug 15, 2009

Get the last occurence of slash in a Path

Sub showNameOnly()

searchKey = “\”
Path = “C:\Test\Sample\Job\KentLau”
lastSlashPosition = InStrRev(Path, searchKey, -1)
MsgBox Len(Path) - lastSlashPosition
MsgBox Right(Path, 7)

End Sub

No comments: