+ Reply to Thread
Results 1 to 4 of 4

Formula for name of Sheet

  1. #1
    mariusz
    Guest

    Formula for name of Sheet

    Hello!

    Is there any formula which put name of sheet to cell on the sheet?
    And very similar question:
    Is there any formula which put name of file to any sheet?
    I have to do something like above but without using VBA.

    Thanks in Advance
    Mariusz

  2. #2
    Aladin Akyurek
    Guest

    Re: Formula for name of Sheet

    Sheet:

    =REPLACE(CELL("Filename",A1),1,SEARCH("]",CELL("Filename",A1)),"")

    File, without the path:

    =REPLACE(REPLACE(CELL("Filename",A1),SEARCH("]",CELL("Filename",A1)),255,""),1,SEARCH("[",CELL("Filename",A1)),"")

    mariusz wrote:
    > Hello!
    >
    > Is there any formula which put name of sheet to cell on the sheet?
    > And very similar question:
    > Is there any formula which put name of file to any sheet?
    > I have to do something like above but without using VBA.
    >
    > Thanks in Advance
    > Mariusz


  3. #3
    JulieD
    Guest

    Re: Formula for name of Sheet

    Hi

    this is an answer posted by Chip Pearson to a similar question awhile back:
    ---
    If the current workbook is C:\Temp\Test.Xls and the sheet is Sheet1,


    Use
    =CELL("filename",A1)
    to get the full name, including the sheet name. E.g.,


    C:\Temp\[Test.Xls]Sheet1
    Use
    =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,LEN(CELL("fil
    ename"
    ,A1))-FIND("]",CELL("filename",A1)))
    to get just the sheet name
    Sheet1


    Use


    =MID(CELL("filename",A1),FIND("[",CELL("filename",A1))+1,FIND("]",CELL
    ("file
    name",A1))-FIND("[",CELL("filename",A1))-1)
    to get just the file name
    Test.Xls

    Use
    =LEFT(CELL("filename",A1),FIND("]",CELL("filename",A1)))
    to get full name without sheet name


    C:\Temp\[Test.xls]
    Use
    =SUBSTITUTE(SUBSTITUTE(LEFT(CELL("filename",A1),FIND("]",CELL("filenam
    e",A1)
    )),"[",""),"]","")
    to get full name without sheet name, and without square brackets
    C:\Temp\Test.Xls


    In all of the formulas above, you can use any cell instead of A1 --
    just use a cell that is on the same sheet as the cell containing the
    formula.


    Cordially,
    Chip Pearson
    ---

    Cheers
    JulieD

    "mariusz" <[email protected]> wrote in message
    news:[email protected]...
    > Hello!
    >
    > Is there any formula which put name of sheet to cell on the sheet?
    > And very similar question:
    > Is there any formula which put name of file to any sheet?
    > I have to do something like above but without using VBA.
    >
    > Thanks in Advance
    > Mariusz




  4. #4
    Bob Phillips
    Guest

    Re: Formula for name of Sheet

    See http://www.xldynamic.com/source/xld.xlFAQ0002.html

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "mariusz" <[email protected]> wrote in message
    news:[email protected]...
    > Hello!
    >
    > Is there any formula which put name of sheet to cell on the sheet?
    > And very similar question:
    > Is there any formula which put name of file to any sheet?
    > I have to do something like above but without using VBA.
    >
    > Thanks in Advance
    > Mariusz




+ 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