View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Magnivy Magnivy is offline
external usenet poster
 
Posts: 70
Default Function to Return File Name of Active Workbook

Thanks a lot for your help Bob!

"Bob Phillips" wrote:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1),1)+1,FIND("]",CELL("fi
lename",A1),1)-FIND("[",CELL("filename",A1),1)-1)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Magnivy" wrote in message
...
Hello,

I'm trying to create a custom function that would return the file name of
the active workbook (as I dont know a worksheet function that would do so
directly), and am not having much luck. I tried

Function filename()
filename = ActiveWorkbook.Name
End Function

but this returns an error. Any suggestions would be greatly appreciated.

Thank You!

Magnivy