Strip file extension from fiel name with multiple periods."file.9.69.txt"

  • Thread starter Thread starter Fan924
  • Start date Start date
F

Fan924

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?
 
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
 
Back
Top