Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Why is path name added to active cell when Excel file is saved? | Excel Discussion (Misc queries) | |||
Show full path of files being saved | Excel Discussion (Misc queries) | |||
New Workbook Path | Excel Discussion (Misc queries) | |||
How can I see a copy of a saved workbook before I saved it again? | Excel Worksheet Functions | |||
Workbook path | Excel Discussion (Misc queries) |