• reference tab name (2003 SP3)

    Author
    Topic
    #456925

    I think this is probably an easy question. Is there a way to make a cell reference the name of a tab (another worksheet)? How?

    Thanks!

    Viewing 1 reply thread
    Author
    Replies
    • #1143687

      Only with VBA code.

      A line of code similar to: Activesheet.Name = Range(“A1”).Value

      It will need to be linked to a worksheet event if it must happen more automatically. If so…please specify more detail of what you want to have happen.

    • #1143791

      If you meant that you want to return the sheet name of a cell, you can use a formula like this:

      =MID(CELL("filename",Sheet2!A1),FIND("]",CELL("filename",Sheet2!A1))+1,256)

      This will only work if the workbook has been saved to disk, not in a newly created workbook.

      • #1143800

        Wow…and I read that question exactly the other way around. This could have been in the puzzle forum. grin

        • #1143803

          I’m not sure what Michael’s question means – I just wanted to provide an alternative.

      • #1143833

        What a useful formula, it solves a problem I didn’t even know I had.

        Thank you.

        StuartR

      • #1143895

        ..so use cell(“address”,
        ..instead of cell(“filename”,
        and tweak formula a bit to get rid $ address etc (find “!” perhaps?) and make allowances for spaces in sheet names and then..
        ..I think it will work even if the workbook has NOT been saved to disk and will work in a newly created workbook

        zeddy

        • #1143900

          Thanks. On the other hand, the formula I posted will also work when the cell is on the same worksheet, while CELL(“address”, …) will only return the cell address without the sheet name if the cell is on the same sheet.

          The OP can choose which formula suits his purposes best.

    Viewing 1 reply thread
    Reply To: reference tab name (2003 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: