Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Strip file extension from fiel name with multiple periods."file.9.69.txt"

I am using this to strip the file extension off of a file name
Range("G6").Value = Left(ActiveWorkbook.Name, InStr
(ActiveWorkbook.Name, ".") - 1)

It messes up with multiple "."
How do I strip off the file extension and far right "." only?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Strip file extension from fiel name with multiple periods. "file.9

Try using INSTRREV , it gets the first "." from the end.
--
HTH,

Barb Reinhardt



"Fan924" wrote:

I am using this to strip the file extension off of a file name
Range("G6").Value = Left(ActiveWorkbook.Name, InStr
(ActiveWorkbook.Name, ".") - 1)

It messes up with multiple "."
How do I strip off the file extension and far right "." only?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Strip file extension from fiel name with multiple periods. "file.9.69.txt"

On Tue, 19 Jan 2010 15:23:01 -0800 (PST), Fan924 wrote:

I am using this to strip the file extension off of a file name
Range("G6").Value = Left(ActiveWorkbook.Name, InStr
(ActiveWorkbook.Name, ".") - 1)

It messes up with multiple "."
How do I strip off the file extension and far right "." only?



Perhaps:

Left(activeworkbook.name, InStrRev(fn, ".") - 1)

--ron
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Excel Discussion (Misc queries) 0 April 23rd 09 08:53 PM
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. Phillip Pi Setting up and Configuration of Excel 0 April 23rd 09 08:53 PM
"Open With" Excel Does Not Work For TXT File Extension Rick Hamilton Excel Discussion (Misc queries) 4 September 17th 07 03:26 AM
Why does my excel file have an extension reading ".xls:1"? Steve Irmin Excel Discussion (Misc queries) 2 January 24th 06 11:21 PM
Problem- Recording macros for "file save" and "File open" tritaco Excel Programming 1 April 22nd 04 06:15 PM


All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"