file name

  • Thread starter Thread starter Susie
  • Start date Start date
S

Susie

Hello All,

Is there a way (formula) that will identify my file name
with out using VB. i.e. I have a file that I rename
every month and would like a particular cell to tell me
the month I am in. My workbook is Named.....
"Nov Sales Data" I would like the cell to show "Nov".

Also I would like two cells to show the numeric value for
the month. A1 = 1 A2=0 for Nov (10) or A1 = 0 A2 = 8
for Aug.

Thanks in advance for your help :)
 
Try Debra Dalgleish's site:

http://www.contextures.com/xlfaqFun.html#SheetName

Oh, heck:

=CELL("Filename",A1)
returns the complete file path and sheet name

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
will strip away everything but the sheet name.

Note: The file must be saved or the formula will not work.

And to pick out the first 3 characters of the workbook's name:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,3)
 
You could use:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))
+1,FIND(" ",CELL("filename",A1),FIND("[",CELL
("filename",A1)))-FIND("[",CELL("filename",A1))-1)

I don't follow your logic on the second part.

HTH
Jason
Atlanta, GA
 
And to get the number of the month from the first 3 characters of the workbook
name:

=MONTH(DATEVALUE(A1&" 1, 2003"))

(where A1 contained that other formula.)

Dave said:
Try Debra Dalgleish's site:

http://www.contextures.com/xlfaqFun.html#SheetName

Oh, heck:

=CELL("Filename",A1)
returns the complete file path and sheet name

=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
will strip away everything but the sheet name.

Note: The file must be saved or the formula will not work.

And to pick out the first 3 characters of the workbook's name:

=MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,3)
Hello All,

Is there a way (formula) that will identify my file name
with out using VB. i.e. I have a file that I rename
every month and would like a particular cell to tell me
the month I am in. My workbook is Named.....
"Nov Sales Data" I would like the cell to show "Nov".

Also I would like two cells to show the numeric value for
the month. A1 = 1 A2=0 for Nov (10) or A1 = 0 A2 = 8
for Aug.

Thanks in advance for your help :)
 
Back
Top