File Pahtway in Cell

  • Thread starter Thread starter Maxwell_5000
  • Start date Start date
M

Maxwell_5000

What is the formula to tell you the pathway of the excell file you are
currently in?

(i.e. C:\my document\ms office\excel\mikes folder)

I thought the formula was "=Cell()" but it does not work...

please help :confused:
 
You can create a function for that...

In the VBE put the following
Function FilePath() as String
FilePath = activeworkbook.path
End Function

And then use that for your formula (however, the code would have to b
added to any workbook you were going to use it on
 
=cell("filename")

When you use this function, you should always include a cell
reference in the function call:

=CELL("filename",A1)

It doesn't matter what the cell reference is, as long as it is on
the same sheet as the function. The reason is that without the
cell reference, Excel will use the ActiveSheet and ActiveWorkbook
to return the filename, and these may not be the same as the
sheet and workbook containing the formula.

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

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