Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
remove last part of string
I need to create a text string from a variable length file name by removing
the .xls from the end of the file name. It would be easy if the file names were a fixed length, but they are not. Is there another easy way? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
remove last part of string
"Mitch" wrote in message
... I need to create a text string from a variable length file name by removing the .xls from the end of the file name. It would be easy if the file names were a fixed length, but they are not. Is there another easy way? Hi Mitch, Here's one way to do it: Dim szFilename As String Dim szNameOnly As String szFilename = "My File Name.xls" szNameOnly = Left$(szFilename, Len(szFilename) - 4) -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
remove last part of string
One way:
sFileName = Left(sFileName, Len(sFileName) - 4) or, if you weren't sure whether the extension was there or not: sFileName = Replace(sFileName, ".xls", "") In article , "Mitch" wrote: I need to create a text string from a variable length file name by removing the .xls from the end of the file name. It would be easy if the file names were a fixed length, but they are not. Is there another easy way? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
vlookup part of string... | Excel Discussion (Misc queries) | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
Extract Part of String | Excel Worksheet Functions | |||
Remove part of string | Excel Programming | |||
extracting part of string value | Excel Programming |