Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying a String 1

Status
Not open for further replies.

Creigbm

Mechanical
Aug 1, 2003
161
I am not sure if there is a way to accomplish this, but I am trying to get the title of a document by knowing the filename. For example, I have this filename:

C:/fdfd/fdfdse/sfsf/PART.dwg

Is there a way to 'get rid of' eveything in the string except for the PART.dwg? Note that the length of the string is ever changing so I cannot hard code it to subtract 20 characters from the left. Thanks in advance for any help.
 
Replies continue below

Recommended for you

Depending on which version of VBA you have, you may have at your disposal the InStrRev function. If so, you can use that to locate the last slash -- forward slash and back slash are not the same character -- and from that location, use the mid function to extract the balance of the string.
 
Thanks, I will give that a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor