Thursday, January 18, 2007

Get the name of the worksheet

   =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)
CELL function returns the file name of the currently opened workbook, appendixed by the worksheet the referenced cell (A1 in this case) is on. The file name is quoted in squre brackets. Other information can be retrieved with the same function includes "width", "format", etc. Here for details.