Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Path where Workbook is saved

What is the code that will detect the patch of where the
Active Workbook is saved and put that in cell A1? For
instance the Activate workbook is called Stats Manager and
is saved in C:\Data\Stats Manager.Xls. When the code is
run I need for it to put the value "C:\Data\Stats
Manager.Xls" in cell A1.


Thanx

Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Path where Workbook is saved

Todd,

For the path without the file name, use

Range("A1").Value = ActiveWorkbook.Path

For the full file name, including path and file name, use

Range("A1").Value = ActiveWorkbook.FullName


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


"Todd Huttenstine" wrote in
message ...
What is the code that will detect the patch of where the
Active Workbook is saved and put that in cell A1? For
instance the Activate workbook is called Stats Manager and
is saved in C:\Data\Stats Manager.Xls. When the code is
run I need for it to put the value "C:\Data\Stats
Manager.Xls" in cell A1.


Thanx

Todd



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Path where Workbook is saved


Range("a1") = ThisWorkbook.Path

or

Range("a1") = ActiveWorkbook.Pat

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Path where Workbook is saved

=LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1)))
produces
C:\Data\[Stats Manager.Xls]

to remove the brackets

=substitute(Substitute(formula,"]",""),"[","")

=SUBSTITUTE(SUBSTITUTE(LEFT(CELL("filename",A1),FI ND("]",CELL("filename",A1)
)),"]",""),"[","")

--
Regards,
Tom Ogilvy


Todd Huttenstine wrote in message
...
What is the code that will detect the patch of where the
Active Workbook is saved and put that in cell A1? For
instance the Activate workbook is called Stats Manager and
is saved in C:\Data\Stats Manager.Xls. When the code is
run I need for it to put the value "C:\Data\Stats
Manager.Xls" in cell A1.


Thanx

Todd



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
Why is path name added to active cell when Excel file is saved? [email protected] Excel Discussion (Misc queries) 1 June 28th 07 04:39 PM
Show full path of files being saved JERRY Excel Discussion (Misc queries) 4 May 16th 06 07:57 PM
New Workbook Path exceluserforeman Excel Discussion (Misc queries) 2 December 7th 05 12:10 AM
How can I see a copy of a saved workbook before I saved it again? Norma Excel Worksheet Functions 2 May 11th 05 10:31 AM
Workbook path nc Excel Discussion (Misc queries) 2 April 4th 05 03:37 PM


All times are GMT +1. The time now is 05:56 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"