ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   workbook name (https://www.excelbanter.com/excel-programming/363296-workbook-name.html)

ceemo[_69_]

workbook name
 

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

--
ceem
-----------------------------------------------------------------------
ceemo's Profile: http://www.excelforum.com/member.php...fo&userid=1065
View this thread: http://www.excelforum.com/showthread.php?threadid=54854


[email protected]

workbook name
 
Hi Ceemo,

Try Activeworkbook.Name also if you also need location you could use
Activeworkbook.FullName.

James

ceemo wrote:
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



Chip Pearson

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





All times are GMT +1. The time now is 07:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com