File Pahtway in Cell

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

kraljb

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
 
C

Chip Pearson

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