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
 

Some videos you may like

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

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,014

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,014

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,014
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]
 

Watch MrExcel Video

Forum statistics

Threads
1,118,084
Messages
5,570,129
Members
412,305
Latest member
Mozz
Top