Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default EASY QUESTION: Formula to add filename to cell

"Martin" wrote in message
=CELL("filename")


If only it were really that simple. You'll get into problems with that
formula if the workbook containing that formula is not the active workbook
when Excel decides to do a full recalculation. Moreover, your formula
includes the square brackets around the file name and includes the sheet
name. Instead, use the following formula:

=SUBSTITUTE(LEFT(CELL("Filename",A1),FIND("]",CELL("Filename",A1),1)-1),"[","")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)



"Martin" wrote in message
...
=CELL("filename")

"b" wrote:

Is there a formula I can use that will place the file name in a cell?



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
easy formula question j lunis Excel Worksheet Functions 2 May 28th 09 07:01 PM
Question about filename formula .. Matt[_33_] Excel Programming 14 October 6th 05 07:36 PM
Easy Formula Question - if you know how! Anthony Excel Discussion (Misc queries) 5 July 31st 05 10:37 PM
Easy formula question BabyBlueAXiD Excel Worksheet Functions 2 July 6th 05 10:26 PM
Easy formula Question Excel formula fix Excel Worksheet Functions 3 March 29th 05 02:04 AM


All times are GMT +1. The time now is 02:03 PM.

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

About Us

"It's about Microsoft Excel"