Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove File Path - just keep name
I have a file name that includes the entire file path, file name, and
extension: C:\Documents and Settings\Desktop\Master Schedules\Overall IMS - 26May2006.mpp I need some code to shorten that to just: Overall IMS - 26May2006.mpp I can't just type it in because the file is different each time, based on user input. Thanks in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove File Path - just keep name
ShortFileName = Right(LongFileName,Len(LongFileName) - _
InStrSev(LongFileName, Application.PathSeparator)) HTH Charles Chickering Ski wrote: I have a file name that includes the entire file path, file name, and extension: C:\Documents and Settings\Desktop\Master Schedules\Overall IMS - 26May2006.mpp I need some code to shorten that to just: Overall IMS - 26May2006.mpp I can't just type it in because the file is different each time, based on user input. Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove File Path - just keep name
InStrSev
should be InStrRev And this will work in xl2k and above (InStrRev was added in xl2k). Die_Another_Day wrote: ShortFileName = Right(LongFileName,Len(LongFileName) - _ InStrSev(LongFileName, Application.PathSeparator)) HTH Charles Chickering Ski wrote: I have a file name that includes the entire file path, file name, and extension: C:\Documents and Settings\Desktop\Master Schedules\Overall IMS - 26May2006.mpp I need some code to shorten that to just: Overall IMS - 26May2006.mpp I can't just type it in because the file is different each time, based on user input. Thanks in advance -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove File Path - just keep name
Doh! I hate typos. Oh well, I guess that's what you get when you wing
stuff instead writing it in the editor. How long has the Application.PathSeparator been around? I just included that to make it Mac friendly as well, is that going to be a problem in earlier versions? Charles Dave Peterson wrote: InStrSev should be InStrRev And this will work in xl2k and above (InStrRev was added in xl2k). Die_Another_Day wrote: ShortFileName = Right(LongFileName,Len(LongFileName) - _ InStrSev(LongFileName, Application.PathSeparator)) HTH Charles Chickering Ski wrote: I have a file name that includes the entire file path, file name, and extension: C:\Documents and Settings\Desktop\Master Schedules\Overall IMS - 26May2006.mpp I need some code to shorten that to just: Overall IMS - 26May2006.mpp I can't just type it in because the file is different each time, based on user input. Thanks in advance -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove File Path - just keep name
I believe it was there in xl95.
(I actually used to use it until I got too lazy! And we were a WinTel only shop.) Die_Another_Day wrote: Doh! I hate typos. Oh well, I guess that's what you get when you wing stuff instead writing it in the editor. How long has the Application.PathSeparator been around? I just included that to make it Mac friendly as well, is that going to be a problem in earlier versions? Charles Dave Peterson wrote: InStrSev should be InStrRev And this will work in xl2k and above (InStrRev was added in xl2k). Die_Another_Day wrote: ShortFileName = Right(LongFileName,Len(LongFileName) - _ InStrSev(LongFileName, Application.PathSeparator)) HTH Charles Chickering Ski wrote: I have a file name that includes the entire file path, file name, and extension: C:\Documents and Settings\Desktop\Master Schedules\Overall IMS - 26May2006.mpp I need some code to shorten that to just: Overall IMS - 26May2006.mpp I can't just type it in because the file is different each time, based on user input. Thanks in advance -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I remove an invalid path for an Access file from a pivot | Charts and Charting in Excel | |||
How can I remove an invalid path for an Access file from a pivot | Charts and Charting in Excel | |||
Formula too long - new file path is shorter than old file path - Excel 2003 | Excel Worksheet Functions | |||
How to remove path from macro reference | Excel Discussion (Misc queries) | |||
Remove Hyperlink Path Message | Excel Programming |