+ Reply to Thread
Results 1 to 26 of 26

Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

  1. #1
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    I am trying to find a way to create a side panel (like what is seen in Windows Explorer) in Excel that will display all open workbooks and their associated worksheets in a tree view. I am hoping it can function in all versions of excel, and have the features to rename worksheets and manually drag and drop the worksheets for custom sorting.
    Last edited by fdegree; 03-07-2012 at 09:24 PM.

  2. #2
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    I realize all of this can be done by right clicking on the worksheet tab at the bottom of the screen and right clicking on the VCR controls at the bottom left of the screen. But, the workbooks that I create can range from 20 pages to over 700 pages. When I have a workbook with 100's of pages, I think it would so much easier to sift through them from a separate window pane that has them all listed.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    I can't imagine anything helping with 700 worksheets
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    You may be right...

    Any ideas on how to create this to find out.

    I'm thinking if there is a window pane listing the workbooks and worksheets, that would allow for about 30 pages to be viewed at the same time...making it easier to select, sort and rename them as necessary, instead of only having about 4 or 5 tabs at the bottom that can be viewed at any one time...30 vs. 5 seems easier and faster to me.

  5. #5
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    There is another approach that might work for you. You will have a 'Master' sheet that will contain all the sheet names and their current order. Whenever you make a name change here then the name of that worksheet will be updated. If you change the tab order then that tab order will be changed also. I have began the coding to see if I can do it but it will take a little longer than I had originally anticipated. Would you be interested in this kind of approach?
    Please consider:

    Thanking those who helped you. Click the star icon in the lower left part of the contributor's post and add Reputation.
    Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  6. #6
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    This sounds interesting...let me see if I understand this before you put too much time into it.

    There will be a "Master" worksheet (maybe at the front of the workbook) that will list every sheet in the workbook. On this "Master" worksheet I can:
    1. Change any name on this "Master" worksheet and the actual name of that worksheet automatically changes.
    2. I can manually sort the worksheets, into any order I want, from this "Master" worksheet.

    Couple of questions:
    1. Will the "Master" worksheet automatically update as new worksheets are added to the workbook?
    2. How will the sorting be accomplished? I'm assuming drag-and-drop is out.
    2. Can this be done from a separate window pane? The reason I ask...when the workbook is complete, I generate a table of contents, and I also print the entire workbook. I don't want this "Master" worksheet included in either of them. I could just delete this "Master" sheet before creating a table of contents and printing, but I was hoping this would not be necessary...I am kinda forgetful sometimes.

  7. #7
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Couple of questions(answers):
    1. yes, new sheet can trigger the update
    2. Sorting will be by changing the order number in column B.
    2. Let me see if I can get it going with the same workbook and then we can see if we can do it in a separate workbook.

    Just for confirmation, you are using Office 2000. Is this correct?

    abousetta

  8. #8
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Yes, I am using Office 2000. But, if there is a way, I would like it to work with any excel version.

    Thanks for your help...I sincerely appreciate it.

  9. #9
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    I'm using Excel 2010 and so I won't be able to test it on your version of Excel. I will try to make sure I don't use any of the newer functions, but you will have to let me know if I do.

  10. #10
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    No problem...whatever you need

    Thanks!!!!

  11. #11
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Here is what I have so far. On opening the file, activating the "Master" sheet or making any updates to the Master sheet, it will update the Sheet Names and Sheet Index. I have added error trapping whenever possible. But a few things to keep in mind, sorting or filtering will not trigger any events so advised not to do this as it is counterproductive.

    Here's what the file can do:

    1) If you add a new sheet to the workbook, it will update the Master sheet
    2) If activate the Master sheet, if will update the Master sheet
    3) If you change a sheet's name in the Master sheet, the macro will update the sheet name in the workbook and then update the Master sheet altogether.
    4) If you change the order number (Index number) of a sheet, the macro will move the sheet to the new position in the workbook and then update the Master sheet altogether.
    5) If you try to use a sheet number that is not allowed (#0, #1, or a # more than the number of sheets that you have in the workbook, then an error message will describe your problem and the reason you can't do this.
    6) If you are hungry or thirsty, the macro will go and prepare dinner , etc.

    Pitfalls...
    * Keep the "Master" sheet as the first sheet, unless you have a really good reason why you want to move it.
    * I have not put an error trapping for checking the length of the new worksheet name that is being changed (could do this if necessary)

    Let me know if you have any problems or need any further tweaks.

    Good luck.

    abousetta
    Attached Files Attached Files

  12. #12
    Forum Expert OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,655

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Can we ask why you have 700 sheets in a workbook?
    Good luck.

  13. #13
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Quote Originally Posted by abousetta View Post
    Here is what I have so far.
    6) If you are hungry or thirsty, the macro will go and prepare dinner , etc.
    This is the absolute best feature...no I can fire my maid and butler.

  14. #14
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Quote Originally Posted by abousetta View Post
    Let me know if you have any problems or need any further tweaks.

    Good luck.

    abousetta
    It works great if I open the .xls file that you have attached, and then build the workbook by adding the worksheets. But, if I open an existing workbook and then try to tun the macro I get the following:
    Run-time error '9':
    Subscript out of range

    Then when I click on the Debug button, the following line of the code is highlighted:
    With Worksheets("Master")

    Any thoughts?

  15. #15
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    It is looking for worksheet named "Master". This name can be changed to any name you want just make sure you make these changes in both ThisWorkbook and Module1. Whatever name you decide to replace the current "Master" worksheet name with just make sure to put it as the first sheet in the workbook.

    Good luck and thanks for the feedback. I personally tested it out with a dummy workbook and 100 worksheets and it had no problem updating everything in a second. Let me know if you have any more problems.

  16. #16
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Quote Originally Posted by OnErrorGoto0 View Post
    Can we ask why you have 700 sheets in a workbook?
    The use I have for excel does not utilize it's full potential. I simply use it to create a report that shows how different pieces of equipment are performing for my clients. It is a great program for creating custom sheets that have blank cells to enter the necessary information. There is some use of formulas that are assigned to specific cells, but that is about the extent of excels potential that I use, with the exception of a few macros.

    Hope that makes sense.

  17. #17
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Quote Originally Posted by abousetta View Post
    It is looking for worksheet named "Master". This name can be changed to any name you want just make sure you make these changes in both ThisWorkbook and Module1. Whatever name you decide to replace the current "Master" worksheet name with just make sure to put it as the first sheet in the workbook.

    Good luck and thanks for the feedback. I personally tested it out with a dummy workbook and 100 worksheets and it had no problem updating everything in a second. Let me know if you have any more problems.
    Thanks...I have to cook dinner right now...grilling steak. I'll play with it more a little later.

  18. #18
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Good I was getting hungry and going to put a pizza in the oven, but a streak sound much better enjoy

  19. #19
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    What Rory means is that you could probably make a template (one sheet) and put all your clients' data in a table (a second sheet) then have excel loop through each row (each containing a different client's data) and print the template. Now you will only need two sheets. I know it sounds simpler than it is, but it can usually be done with a lot less than 700 sheets.

  20. #20
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Perhaps it's me...I'm still kind of new to VBA and still learning.

    I opened an existing workbook and inserted a new blank worksheet as the first page. I then renamed this new sheet as "Master". I ran the macro...
    * It created a list of every sheet in the workbook in column "A" and the proper page number in column "B"...good so far.
    * When I change the name of any sheet on the "Master" page, it does not update the actual name of that associated page. I also renamed the actual sheet, but the "Master" sheet did not update itself with the new name.
    * I changed the page number on the "Master" sheet but it did not resort the actual pages.

    Basically, it creates a table of content, but it doesn't respond to any changes.

    It has to be something silly on my end, because when I originally opened your file it worked perfectly.

  21. #21
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Quote Originally Posted by abousetta View Post
    What Rory means is that you could probably make a template (one sheet) and put all your clients' data in a table (a second sheet) then have excel loop through each row (each containing a different client's data) and print the template. Now you will only need two sheets. I know it sounds simpler than it is, but it can usually be done with a lot less than 700 sheets.
    I'm not sure I'm following your description, but I think I got it.

    Considering the nature of the report, I need one page for each individual piece of equipment, and no two pieces are the same. Therefore, the need for 100's of sheets for some projects.

  22. #22
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    If it ain't broke... don't fix it

  23. #23
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Perhaps I'm inpatient...did you overlook my post above describing the problems I'm having? It's post #20

  24. #24
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Sorry about misreading your post. Did you copy and paste all the code in the right places. There are three set of code you need to add to your workbook:

    1) Code is in Module1 (looks like you copied this over fine)
    2) Code in ThisWorkbook (this triggers an update when changes are made in the master worksheet - don't think you copied this over)
    3) Code in "Master" Worksheet (triggers an update when this sheet is activated - don't think you copied this over either)

    Let me if this resolves your problems.

  25. #25
    Registered User
    Join Date
    02-28-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Works perfectly now...sorry for not following your instructions the first time.

    Hope the pizza was good...I know my steak was. Personally, I'd rather have pizza, but we made homemade pizza last night

  26. #26
    Forum Guru
    Join Date
    03-12-2010
    Location
    Canada
    MS-Off Ver
    2010 and 2013
    Posts
    4,418

    Re: Explorer/Navigator/Tree View Of Open Workbooks and Associated Worksheets

    Glad it all worked out fine.

    Good luck.

+ 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