Write filepath to file

  • Thread starter Thread starter HappySenior
  • Start date Start date
H

HappySenior

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
 
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
 
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







- Show quoted text -

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top