=cell("filename")

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi.
I have an issue when putting the following function into
cells of various worksheets.
=cell("filename")

This just displays the file path with workbook and the
respective worksheet. The problem is when I put it into
different worksheets of the same workbook it doesn't
update for the current worksheet. It reads the same
worksheet for the every instance of =cell("filename").

thanks for the help,
Chris.
 
That's because the formula as you have it is looking at the active worksheet
each time. You need to add a cell reference, eg for the sheet name:-

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
 
This is an instance when a moment or two of looking at XL Help would
have been of use:

CELL() will display the filename of the last workbook where a change
occurred unless you use the reference argument. From Help:
Reference is the cell that you want information about. If omitted,
information specified in info_type is returned for the last cell that was
changed. The following list describes the text values CELL returns when
info_type is "format", and reference is a cell formatted with a built-in
number format.


So use =CELL("filename",A1)
 
Back
Top