Insert Workbook File Name :: MrExcel Message Board


 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

Insert Workbook File Name
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Mechanic
Board Regular


Joined: 27 Mar 2002
Posts: 49

Flag: Blank

Status: Offline

 Reply with quote  

Insert Workbook File Name

I would like to place the spreadsheet file name in a cell and have it update automatically as I rename the spreadsheet. Is there an Excel 97 function that does this? If not how do I do it?

Mechanic

Post Fri Sep 19, 2003 5:00 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: Insert Workbook File Name

If you use MoreFunc:

=FILENAME()

if not:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL("filename",A1))-FIND("[",CELL("filename",A1))-1)
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 5:09 pm 
 View user's profile Send private message Visit poster's website

HalfAce
Board Master


Joined: 07 Apr 2003
Posts: 685
Location: Cordova, Alaska
Flag: Blank

Status: Offline

 Reply with quote  

Re: Insert Workbook File Name

Hi mechanic,
In your ThisWorkbook module, enter this:

code:

Private Sub Workbook_Open()
[A1].Value = Me.Name
End Sub




This assumes you want the file's name to be in cell A1. (Change to suit.)

Hope this helps,
HalfAce

Post Fri Sep 19, 2003 5:13 pm 
 View user's profile Send private message

Iridium
Board Master
Board Master


Joined: 16 Jul 2002
Posts: 2581
Location: Walsall, England
Flag: England

Status: Offline

 Reply with quote  

Re: Insert Workbook File Name

Also

=CELL("filename")

HTH
_________________

Post Fri Sep 19, 2003 5:20 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.