get just the last part of a file name after the last "\"

FileName with path:
C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle
how can i extract just the 9-spot bet 1.50.cle ?
isnoend2001Asked:
Who is Participating?
 
Martin LissConnect With a Mentor Older than dirtCommented:
There are a couple of ways but here's one

Dim strParts As String

strParts = Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

Msgbox strParts(ubound(strParts))
0
 
Martin LissOlder than dirtCommented:
Sorry, change

Dim strParts As String

to

Dim strParts() As String

and

Split(?C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

to

Split("C:\Documents and Settings\All Users.WINDOWS\Documents\Real20CardKeno\KingKeno\SavedKingKenoGames\9-spot bet 1.50.cle","\")

I apologize for the mistakes.
0
 
isnoend2001Author Commented:
Thanks again.
Learned something unrelated.
seems Thunderbird does not show new mail icon on taskbar if inbox is not open. At least i think is why i am not getting notifications on the task bar
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
isnoend2001Author Commented:
Seems vb gives an error
Dim strParts As String
      strParts = Split(myfile, "\")
      Debug.Print strParts(UBound(strParts))<-- expected array
0
 
Martin LissOlder than dirtCommented:
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
0
 
Martin LissOlder than dirtCommented:
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
Please see my second post.
0
 
isnoend2001Author Commented:
gottacha missed the
Dim strParts() As String
thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.