filepath formula

D

dave

Isnt there a formula in excel which will list the filepath
in the spreadsheet? I know you can do it in a header or
footer, but cant you do it inside a particular cell?

tia,
Dave
 
R

Ron de Bruin

Hi dave

One way

Function Path() As String
Path = Application.ActiveWorkbook.Path
End Function

Function FullName() As String
FullName = Application.ActiveWorkbook.FullName
End Function

You must paste the functions in a normal module

You can do this in the worksheet
=Path()

or

=FullName()
 
L

Laura Cook

FYI:

CELL is a volatile function that recalculates whenever the worksheet is
recalculated. If the 'last' recalculation takes place when a worksheet other
than the one you have placed the CELL formula in is active, then having no
second argument in the CELL formula will return the worksheet name of the
then active sheet.

If you use a second argument that represents a cell within the sheet where
CELL is entered, then when it recalculates, it will return the "filename" of
the sheet in which this second argument cell is located.
 

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

Top