File name shown in spreadsheet?

chaju

Board Regular
Joined
Mar 24, 2002
Messages
82
Hi It will be great if anyone could help me with this!

Suppose the file name is 'AA 26 Mar 02'
In Cell A1 (say) I have text 'BB 26 Mar 02'

If I save the file with new name to 'AA 27 Mar 02' how can Cell A1(say) change to 'BB 27 Mar 02' such that whenever I change the date within the filename will automatically change the date in Cell A1.

Thanks every one!!

Looking for your quick reply
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi,

You can try to insert the following formula into cell A1, but I am not too sure whether there are better ideas.

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

HTH
 
Upvote 0
Chaju
Try this one. If you are removing more than 2 characters at the start of the filename, you will need to change the 2 at the end of the formula. You could replace the hard coded "BB" with a cell ref to give you flexibility, which I think might be what BabyTiger is referring to. This builds on BabyTigers idea.

"BB"&RIGHT(CELL("filename"),LEN(CELL("filename"))-FIND("[",CELL("filename"))-2)

HTH
Richard
This message was edited by RichardS on 2002-03-26 19:51
 
Upvote 0
thank.. but it has shown "BB 26 Mar 02.xls]Sheet1" instead of the intended BB 26 Mar 02


Any more advise?
Thanks
 
Upvote 0
Sorry Chaju, was testing in cell D12, that's why D12 showed up in the previous post. You can try the following, what I did was to replace D12 with Cell("filename"):

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

HTH
 
Upvote 0
The formula I have hyst posted would show BB 26 Mar 02.xls, if you don't want to see '.xls' as well, then try the following:

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

HTH

NP RichardS, but your formula is the correct one anyway, I have missed the "BB" part, silly me.

Thansk
This message was edited by BabyTiger on 2002-03-26 20:36
 
Upvote 0
Sorry, TigerBaby closer than me. Try
="BB"&MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)
Richard

Sorry BabyTiger, messing around while you were posting
This message was edited by RichardS on 2002-03-26 20:16
 
Upvote 0
Thanks for both of you... but funny enough..

Tiger, Your
=MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-5)

will produce AA 27 Mar 02

And RichardS, your
="BB"&MID(CELL("filename"),FIND("[",CELL("filename"))+1,FIND("]",CELL("filename"))-FIND("[",CELL("filename"))-1)

will produce BBAA 27 Mar02.xls

Sorry for the advise needed again!!

I look forward to hearing both of you soon
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top