Create/Update sheets based on added/modified information on master sheet

  • Re: Create/Update sheets based on added/modified information on master sheet


    I get Runtime Error 9 on the next 2 lines. Subscript out of range.



    Thank you for your continued help with this. I really appreciate all the time you're putting into this for me.

  • Re: Create/Update sheets based on added/modified information on master sheet


    Yep!


    I forgot to set ws to nothing

  • Re: Create/Update sheets based on added/modified information on master sheet


    Works!! But now for a few questions:


    1. Is it possible to make it generate the new sheets even if there are no 'x' marks for that person? Many of the names will not earn awards for quite a while.
    2. Can we have the new sheets appear at the end of the list instead of the start as they do in this latest version? If not, I can just use the Sort function I already have, but that leads to another question:
    3. I liked how you had the sheets corresponding to deleted names move to the front of the list. Can that happen again? But keep the deleted names separate from the other names? Or perhaps just rename the deleted sheets to [Last, First (deleted)] or something?

  • Re: Create/Update sheets based on added/modified information on master sheet


    1) Possible
    2) Possible
    3) Do you mean, move the worksheet(s) that are not in the list to the front of the cadets?

  • Re: Create/Update sheets based on added/modified information on master sheet


    3. What I meant was, one of the versions you posted moved deleted names to the front of the list, but after the cadet name. You uploaded the file DatabaseV3-Reviced.
    i.e. if these are the sheets, it was [Cadets] , [Deleted Person 1] , [Deleted Person 2] , [First Name Alphabetically] ... [Last Name Alphabetically]



    I think it would be better (and easier) though to just leave them in alphabetically order and use the sheet name [Last, First (deleted)] format for names that get deleted from the [Cadets] sheet.



    Could you please make #1 and 3 happen? I'll use the sorter for #2 so it doesn't really matter where new sheets are added in the list.

  • Re: Create/Update sheets based on added/modified information on master sheet


    OK
    change to


    and add


    Note; if the order that you wanted is opposite to the resulting order then swop the lines within If close.

  • Re: Create/Update sheets based on added/modified information on master sheet


    Or like this ?
    Deleted names come right after the "Cadets", then sort the sheets of existing names?

  • Re: Create/Update sheets based on added/modified information on master sheet


    Okay, I think we've just about got it! I added a rename function to add (d) to the name of sheets for deleted people.


    The code does something strange to the sorting order if the Cadets sheet is the only sheet when you click Update. All sheets are created, but I have no idea how it determines the order. However, clicking update again fixes the order.


    The last thing I noticed is that if an 'x' is deleted, the corresponding Organization or Award isn't removed from a person's page. Is there an easy fix for that or would it be too much of a hassle?



    Here is my current version. You can run it to see what exactly is happening. Try deleting someone's name from the Cadet sheet as well as removing some of the 'x' marks.

  • Re: Create/Update sheets based on added/modified information on master sheet


    Can you replace "Get_Format" with the following,


    Then I just found a bug in "test"

    Code
    n = 5
                For ii = 13 To 67


    Should be

    Code
    n = 5
                For ii = 14 To 67


    13 should be 14 as column 13 is always blank.

  • Re: Create/Update sheets based on added/modified information on master sheet


    I changed MoveSheets so that the sheets corresponding to deleted names have something that signifies them as removed from the list. Now not only are they at the front, they also have a "(d)" signifying deleted. I just commented it out because I now see that if the workbook is updated repeatedly, a new "(d)" will be added each time.


    It appears that the sheets are sorted correctly with the exception of the last name on the list. The last name defaults to the first sheet after Cadets. The code also seems to only be able to detect and move one sheet at a time so if multiple people are deleted only one name is moved to the front. (I commented out my SortSheets function so that isn't moving stuff around prematurely.)

  • Re: Create/Update sheets based on added/modified information on master sheet


    OK


    If you have


    "Cadets" - "Tom, ABC" - "Bill, DEF" - "Paul, GHI" - "Joe, JKL"


    Then "Mark, MNO" is newly added and "Paul, GHI" is deleted from the list.


    What order do you want after the sort?

  • Re: Create/Update sheets based on added/modified information on master sheet


    I think I may have fixed it...?

  • Re: Create/Update sheets based on added/modified information on master sheet



    Should be:


    "Cadets" - "Paul, GHI (d)" - "Bill, DEF" - "Joe, JKL" - "Mark, MNO" - "Tom, ABC"

  • Re: Create/Update sheets based on added/modified information on master sheet


    Test this hard

  • Re: Create/Update sheets based on added/modified information on master sheet


    This did it!!


    I did make these changes to get it just right:

  • Re: Create/Update sheets based on added/modified information on master sheet


    That's good.


    BTW

    Code
    n=0


    Shouldn't make any difference.
    Variable "n" declared as "Long", so default value = "0" anyway.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!