View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default How to: obtain the filename that a module exists in, via VBA?

Is this what you want?


With Extension:
=============================
ThisWorkbook.Name


Without Extension
=============================
Left(ThisWorkbook.Name, InStrRev(ThisWorkbook.Name, ".") - 1)


--
Rick (MVP - Excel)


"ch" wrote in message
...
Hi Tom,

How can we return a workbook's file name with and without extension?

Thanks in advance.