Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Running a macro to protect a workbook on a already protected workbook UNprotects the workbook ?? WimR Excel Programming 9 July 25th 05 12:44 PM
Copy a range of cells in an unopened workbook and paste it to the current workbook topstar Excel Programming 3 June 24th 04 12:50 PM
What commands do you use to name a workbook, save a workbook,open a workbook Steven R. Berke Excel Programming 1 July 24th 03 11:37 PM


All times are GMT +1. The time now is 09:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"