ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Write filepath to file (https://www.excelbanter.com/excel-programming/417451-write-filepath-file.html)

HappySenior[_2_]

Write filepath to file
 
How can I record in cell A20 on sheet 1, the full path of a file?

I misunderstood a previous post which seeks to open a file by reading
a ws cell.

Don in Montana

Jim Thomlinson

Write filepath to file
 
You don't mention which file you want to get. I am assuming you want the path
of the file running the code...

Range("A20").Value = ThisWorkbook.FullName
If you want the user to browse for the file then try
Range("A20").Value = application.Getopenfilename
--
HTH...

Jim Thomlinson


"HappySenior" wrote:

How can I record in cell A20 on sheet 1, the full path of a file?

I misunderstood a previous post which seeks to open a file by reading
a ws cell.

Don in Montana


HappySenior[_2_]

Write filepath to file
 
On Sep 22, 4:45*pm, Jim Thomlinson <James_Thomlin...@owfg-Re-Move-
This-.com wrote:
You don't mention which file you want to get. I am assuming you want the path
of the file running the code...

Range("A20").Value = ThisWorkbook.FullName
If you want the user to browse for the file then try
Range("A20").Value = application.Getopenfilename
--
HTH...

Jim Thomlinson



"HappySenior" wrote:
How can I record in cell A20 on sheet 1, the full path of a file?


I misunderstood a previous post which seeks to open a file by reading
a ws cell.


Don in Montana- Hide quoted text -


- Show quoted text -


Jim,
You assumed correctly. ThisWorkbook.FullName us exactly what I wanted.
Many Thanks
Don


All times are GMT +1. The time now is 12:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com