+ Reply to Thread
Results 1 to 7 of 7

Cell Reference when the worksheet names change

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Cell Reference when the worksheet names change

    I need a summary workbook of all of the worksheets of a different Workbook. It would pull values from 4 fixed cells, but the number of Worksheets and names of the sheets change.

    Is there a way to do this?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Cell Reference when the worksheet names change

    use a indirect formula
    http://www.contextures.com/xlFunctions05.html
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Cell Reference when the worksheet names change

    I don't think indirect will work. The problem is that users add and delete worksheets and the name of the worksheet is automatically changed and sorted. Need something that will look up the worksheet names and then pull the values from (A1), (J1), (K1) in those worksheets.

    Output would be if possible in a separate workbook or at least in a separate worksheet that would have header row, then rows 2-x (x could be as many as 30) where each row would be values from a different worksheet.

    Thanks for any help.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Cell Reference when the worksheet names change

    If you are doing this in 2 different files/workbooks, then INDIRECT() would only work if both files were open anyway.

    I have a way to ID all sheets in a file (added/deleted/changed etc). Would you consider having a summary sheet in teh "workers" file, then just referencinfg that from teh "master" file?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Cell Reference when the worksheet names change

    Fdibbins,
    Would you consider having a summary sheet in teh "workers" file, then just referencinfg that from teh "master" file?
    That would be fine.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Cell Reference when the worksheet names change

    Sorry for the delay, this is what I had in mind (well, something like thuis)

    Sheet1 of the attached is the summary sheet. It pulls in all the sheet names in the WB, and you can then use that to extract the sheet data.

    Once you have that in 1 sheet, in a structured manner, you can reference that (be that file open or closed) from a 2n WB

    Another (manual) way to get the sheet names...

    Quick list method (from TMS)
    1 Open VBA editor (Alt F11)
    2 hit CTRL-G to open the Immediate Window
    3 paste this...for i=1 to worksheets.Count: ?sheets(i).name: next
    4 Copy/paste resulting list
    Attached Files Attached Files
    Last edited by FDibbins; 05-07-2015 at 08:13 PM.

  7. #7
    Registered User
    Join Date
    12-13-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    78

    Re: Cell Reference when the worksheet names change

    Fdibbns,

    Thanks so much for your help. The attached file works Ok. When I rename a sheet it doesn't change until I close and reload the workbook. If I add a sheet nothing happens even after I added the code on Sheet1 down the rows until I highlight the code and then enter.

    Is there a way for this to happen automatically?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 07-24-2015, 08:33 AM
  2. [SOLVED] How to change the reference worksheet based on a value of a cell
    By macnabong in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-19-2014, 09:33 AM
  3. Change formatting of cells on inactive worksheet using cell reference
    By wedwo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2014, 04:46 AM
  4. [SOLVED] How to change reference to other worksheet by changing one cell?
    By Ms.Vahl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-10-2005, 03:00 AM
  5. Using cell contents to reference worksheet names
    By timsantiago in forum Excel General
    Replies: 5
    Last Post: 11-08-2005, 05:40 PM

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