+ Reply to Thread
Results 1 to 9 of 9

Picking up the name of the sheet

  1. #1
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117

    Picking up the name of the sheet

    Any idea what formula to use if I want a cell in the excel sheet to show the name of the worksheet?
    Thank you in advance,
    Gilbert

  2. #2
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    This will do it for you

    I looked for 4 years before I found this.
    Yes it will. we just have to figure out how...
    If I have helped you, PLEASE click the * and add to my Rep.
    Also, if the problem is SOLVED please mark it as so.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Sounds like you want to use the CELL("filename") Function. Here's a list of the variations you might want;
    For any of these to work the workbook must be saved first.
    Please Login or Register  to view this content.
    Let us know if it works.
    ChemistB

  4. #4
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117
    Quote Originally Posted by ChemistB
    Sounds like you want to use the CELL("filename") Function. Here's a list of the variations you might want;
    For any of these to work the workbook must be saved first.
    Please Login or Register  to view this content.
    Let us know if it works.
    ChemistB
    Ya.. it works well with my worksheet.. but mind to explain a bit how does this formula works? I am using the last one where showing Worksheet name only. Wonder why reference is to cell A1?

  5. #5
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    Okay, starting with your second question. It references cell A1 simply to "ground" the formula within that worksheet. If that were not there, the formula would calculate based on the last sheet you made a change.

    The formula
    Please Login or Register  to view this content.
    returns the entire path including workbook name and sheet name.

    With
    Please Login or Register  to view this content.
    The MID function plucks a certain number of characters from a string with the format =MID(TEXT,Starting Number, Number of Characters).

    The FIND function finds what position (#)the "]" is which appears right before your sheetname and then adds 1 (where your sheetname starts). 255 is an arbitrary number to cover the number of characters in your sheet name.

    ChemistB

  6. #6
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    This should help

    Code remove as unwrapped

  7. #7
    Valued Forum Contributor Dunc3142's Avatar
    Join Date
    09-05-2007
    Location
    Franklin OH
    MS-Off Ver
    2000 and 2007 and 2010 @ Home & Teach 2010
    Posts
    351

    Read doc again

    New lines added.

  8. #8
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117
    How about picking up certain part of the workbook filename, that is without showing the file extension - .xls?
    Last edited by gilbert; 08-14-2008 at 09:27 PM.

  9. #9
    Forum Contributor gilbert's Avatar
    Join Date
    01-08-2004
    Location
    Asia
    MS-Off Ver
    2007
    Posts
    117
    Got it now.....

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


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1