View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default removing the file extention

If the filename also has its path with it...

FileNameOnly = Mid(Left(PathAndFilename, InStrRev(PathAndFilename, _
".") - 1), InStrRev(PathAndFilename, "\") + 1)

If the filename is by itself (that is, without its path)...

FileNameOnly = Left(FilenameAndExtension, _
InStrRev(PathAndFilename, ".") - 1)

--
Rick (MVP - Excel)


"Fan924" wrote in message
...
Is there an easy way of removing the file extention from the file name?