I want excel to retrive the name of the worksheet in a cell?

clausboss

Board Regular
Joined
Sep 13, 2005
Messages
71
Hi

I know that I can make =CELL("filename") to get the file name but if I only wante to retrive the sheet name in file is this possible.

:oops:

Claus
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

clausboss

Board Regular
Joined
Sep 13, 2005
Messages
71
Barry thanks

I had some problems but it gave me a idee have to make it..

=MID(CELL("filename");FIND("]";CELL("filename"))+1;100)

Many thanks
 

justme

Well-known Member
Joined
Aug 26, 2002
Messages
722
how would you change Aladin's code to have the cell report the workbook name only?
 

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,022

ADVERTISEMENT

justme said:
how would you change Aladin's code to have the cell report the workbook name only?
I wouldn't.

I'd defined a named formula, WorkbookName and assign it the formula =Get.Workbook(16) Then in a cell you can just type =workbookname
 

justme

Well-known Member
Joined
Aug 26, 2002
Messages
722
how do you define a named formula? I typed in =Get.workbook(16) and it said That function is not valid.
 

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,022

ADVERTISEMENT

Just like creating a named range, but instead of a range, you define a formula.

From the menu Insert | Name | Define... the name (WorkbookName) goes up top; formula (=Get.Workbook(16)) goes in the ReferTo box.
 

justme

Well-known Member
Joined
Aug 26, 2002
Messages
722
oops, I didn't see your post.

May I assume I can pull the folder name the same way??
 

Greg Truby

MrExcel MVP
Joined
Jun 19, 2002
Messages
10,022
Sorry, when you said "workbook name only" I took that to mean excluding the path. If you want the path, then just edit Aladin's formula to pull off the left, i.e.: <ul>[*]=LEFT(CELL("filename",A1),SEARCH("]",CELL("filename",A1)))[*]=LEFT(CELL("filename",A1),SEARCH("[",CELL("filename",A1))-1)[/list]
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,991
Messages
5,834,764
Members
430,319
Latest member
Excelhelppll

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
Top