Thread: workbook name
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default workbook name

You can use ActiveWorkbook.Name or .FullName to return the name
or full name of the workbook that is active, regardless of what
workbook contains the code. You can use ThisWorkbook.Name or
..FullName to return the name of the workbook which contains the
code, regardless of what is active.

If you are going to be calling this from a worksheet cell, use

Function WorkbookName() As String
WorkbookName = Application.Caller.Parent.Parent.Name
End Function


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"ceemo"
wrote in message
...

I have a formula to pull the workbook name but is there a way
to do it
in code?


--
ceemo
------------------------------------------------------------------------
ceemo's Profile:
http://www.excelforum.com/member.php...o&userid=10650
View this thread:
http://www.excelforum.com/showthread...hreadid=548546