+ Reply to Thread
Results 1 to 13 of 13

Merging: displaying which sheet data comes from when merging sheets

Hybrid View

  1. #1
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Merging: displaying which sheet data comes from when merging sheets

    There are two kinds of Excel people - The ones who use formulas in the spreadsheet exclusively and the ones who use VBA exclusively. Ideally - the complete excel programmer should be well versed in both.

    But I'm a VBA person and here's how I'd get the sheet name:

    Sub SheetName()
    Dim S As String
    S = ActiveSheet.Name
    MsgBox (S)
    End Sub
    I've seen formulas in the sheet that also display the name but I didn't save them.

    Hopefully, a formula person or a Compleat Excel Programmer will also hit on this thread.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Merging: displaying which sheet data comes from when merging sheets

    I found it:

    =MID(CELL("filename",A1),SEARCH("]",CELL("filename",A1),1)+1,LEN(CELL("filename",A1)))
    which I doctored from:

    CELL("filename",A1)
    which gives you the fullname.

  3. #3
    Registered User
    Join Date
    07-06-2012
    Location
    Edmonton
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Merging: displaying which sheet data comes from when merging sheets

    what if i wanted to output the worksheet name in a cell on a new sheet rather than displaying it in a message box?

+ 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