Solved

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

Posted on 2014-01-19
7
228 Views
Last Modified: 2014-01-19
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 ?
0
Comment
Question by:isnoend2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 47

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39793379
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
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39793381
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
 

Author Closing Comment

by:isnoend2001
ID: 39793383
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:isnoend2001
ID: 39793390
Seems vb gives an error
Dim strParts As String
      strParts = Split(myfile, "\")
      Debug.Print strParts(UBound(strParts))<-- expected array
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39793391
Sorry, can't help you with Thunderbird but once again I'm happy I was able to answer your question.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39793398
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
 

Author Comment

by:isnoend2001
ID: 39793411
gottacha missed the
Dim strParts() As String
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question