+ Reply to Thread
Results 1 to 10 of 10

Listing tab names in one workbook in another workbook

Hybrid View

  1. #1
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Lightbulb Listing tab names in one workbook in another workbook

    I'm trying to find some non vba approach to grabbing the tab names in workbook A and assigning them to a group of cells in workbook B
    I have no clue...

    A backup plan would be to go with vba
    Last edited by SDruley; 11-09-2010 at 06:09 PM.
    Turn Data into Information
    Turn Information into Knowledge
    Turn Knowledge into Direction
    Turn Direction into Leadership
    Turn Leadership into Results
    Stephen Druley

    It's not how quickly you think
    But how deeply you think
    The quality of thinking is measured
    by remoteness to conformance
    Stephen Druley

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Listing tab names in one workbook in another workbook

    Is Workbook A always open when Workbook B is being used ?

    If so would XLM be permitted ?
    (old Macros but run via Names - pre XL2007 would not generate macro warning etc...)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Listing tab names in one workbook in another workbook

    I guess I should outline my thinking... you could use a Name in Workbook A to store the sheet names:

    Name: _Sheets
    RefersTo: =GET.WORKBOOK(1)
    You could then (to avoid issues re: closed file) add a sheet to Workbook A to list the sheet names - eg create a sheet called "sheetlist" and then

    A1:
    =INDEX(_Sheets,ROWS(A$1:A1))
    copied down as far as necessary
    You can then link to these cells from Workbook B as normal
    (handling #REF! errors etc and trimming the references to remove the file name via formulae in Workbook B)

  4. #4
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Re: Listing tab names in one workbook in another workbook

    Thank you DonkeyOte and Sweep...

    Both Workbooks are always open. Since no program is always the best program, I am going to go with DonkeyOte's approach.

    I will write back with my results.. still working on it.

  5. #5
    Valued Forum Contributor SDruley's Avatar
    Join Date
    04-27-2009
    Location
    Conover, NC
    MS-Off Ver
    Excel 2010 64 bit
    Posts
    415

    Re: Listing tab names in one workbook in another workbook

    My two simple workbook examples are attached. Still having some trouble following through.
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Listing tab names in one workbook in another workbook

    I'm not really sure from looking at the Names you've created in A what you want to do exactly.

    GET.WORKBOOK(1) will return a horizontal array of the sheet names so you can use INDEX etc to retrieve the various items - per earlier post:

    Name: _Sheets
    RefersTo: =GET.WORKBOOK(1)
    Then in terms of the listing returned to a range (for closed target purposes)

    Sheets!A1
    =INDEX(_Sheets,ROWS(A$1:A1))
    copied down
    If you would prefer to tweak the sheet names in place I would suggest an adjacent cell for simplicity sake:

    Sheets!B1
    =IF(ISTEXT(A1),REPLACE(A1,1,FIND("]",A1),""),"")
    copied down
    (you could use IFERROR if to be used excl. XL2007+)
    In workbookB Link to B1 etc in WorkbookA!Sheets

  7. #7
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: Listing tab names in one workbook in another workbook

    If you decide to go for the backup plan:

    Sub a()
    Dim ws As Worksheet, iCount As Integer
    iCount = 1
    For Each ws In Workbooks("Bookname_Name.xls").Worksheets
    Cells(iCount, 1).Value = ws.Name
    iCount = iCount + 1
    Next
    End Sub
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

+ 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