+ Reply to Thread
Results 1 to 3 of 3

using the name of the worksheet as argument

  1. #1
    Registered User
    Join Date
    12-06-2005
    Location
    Buchraest / Romania
    Posts
    2

    Unhappy using the name of the worksheet as argument

    I need to use the name of the currrent worksheet as an argument for a function in that worksheet.

    Is there a way to get that name through some system variable or smthg and use it in a LOOKUP, IF or any other function for that matter ?

    I searched the forums but no clue so far. Any help appreciated.

  2. #2
    Registered User
    Join Date
    12-06-2005
    Location
    Buchraest / Romania
    Posts
    2

    Talking

    after looking it up for hours, i found the answer myself in less then 5 minutes after posting this. for the records, here it is:

    The Cell function returns information about the formatting, location, or contents of the upper-left cell in a reference.

    To get the sheet name:
    =MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)

    To get the workbook name:
    =MID(CELL("filename"),FIND("[",CELL("filename"))+1,(FIND("]",CELL("filename"))+1)-FIND("[",CELL("filename"))-2)

    To get the path address & workbook name:
    =CELL("filename")

    To get the path address:
    =MID(CELL("filename"),1,FIND("[",CELL("filename"))-1)

    oh, got it from exceltip.com

  3. #3
    Dave Peterson
    Guest

    Re: using the name of the worksheet as argument

    You should add a reference to each =cell("filename").

    =MID(CELL("filename",a1),FIND("]",CELL("filename",a1))+1,255)

    You may find that you get the wrong name if you don't include that.

    radulucian wrote:
    >
    > after looking it up for hours, i found the answer myself in less then 5
    > minutes after posting this. for the records, here it is:
    >
    > The Cell function returns information about the formatting, location,
    > or contents of the upper-left cell in a reference.
    >
    > To get the sheet name:
    > =MID(CELL("filename"),FIND("]",CELL("filename"))+1,255)
    >
    > To get the workbook name:
    > =MID(CELL("filename"),FIND("[",CELL("filename"))+1,(FIND("]",CELL("filename"))+1)-FIND("[",CELL("filename"))-2)
    >
    > To get the path address & workbook name:
    > =CELL("filename")
    >
    > To get the path address:
    > =MID(CELL("filename"),1,FIND("[",CELL("filename"))-1)
    >
    > oh, got it from exceltip.com
    >
    > --
    > radulucian
    > ------------------------------------------------------------------------
    > radulucian's Profile: http://www.excelforum.com/member.php...o&userid=29393
    > View this thread: http://www.excelforum.com/showthread...hreadid=491042


    --

    Dave Peterson

+ 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