Filename Function

  • Thread starter Thread starter Steph
  • Start date Start date
S

Steph

Function FName()
FName = ActiveWorkbook.Name
End Function

This returns the filename.xls. Can I add a left function to this to remove
the .xls? I can do it within a cell, but not sure how to edit the function
to do it. Thanks!
 
Hi Steph,

Dim fname As String
fname = ActiveWorkbook.Name
fname = Left(fname, Len(fname) - 4)
MsgBox fname
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top