Link to home
Start Free TrialLog in
Avatar of Tocogroup
TocogroupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Is there an Excel function to display the active workbook name in a cell ?

Hi All,

Is there an Excel function I can use to display the name of the workbook currently open. Or can this only be done in VBA ?

Thanks
T
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

=CELL("filename"; A2)
more details on the CELL function:
http://office.microsoft.com/en-001/excel-help/cell-function-HP010062392.aspx

note: as long as the workbook was not saved, this function will return empty
Define WorkbookName

RefersTo: =GET.DOCUMENT(88)

in A1

=WorkbookName

It'll give you even if the workbook is not saved.

Kris
Avatar of Tocogroup

ASKER

Thanks Guy. It's almost what I want, except I don't want the full file path. Only the filename. Is this possible ?
Read the sentence as "It'll give you the workbook name even if the workbook is not saved."

Somehow I couldn't edit my post.
Kris

Here's the define...

User generated image
But I'm getting a #NAME? error in the cell.
ASKER CERTIFIED SOLUTION
Avatar of krishnakrkc
krishnakrkc
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Whoops ! Yep you were right. Thanks for that. Works great.