+ Reply to Thread
Results 1 to 36 of 36

Add or Update Worksheets based on Column Status from Master Data to Another Sheet

  1. #1
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    I Have One master data Sheet ("Application") in the excel table format. Table Name "APPLICATIONTBL".
    In "X" Column there is status (Red, Amber, Green etc.)
    I need to create a macro:
    if the worksheets for any specific status available then it will update the data of that particular status . Like If the "Amber" Sheet are available the when we do the entry in master data ,it will automatically update all the data from master sheet for "Amber" Status" in Amber Sheet.
    if the Sheet are not available then it will add worksheets and create the table with only that specific Status.
    Like sheet name "Red" is not there, so it will create a sheet with "Red" name and pull the data of Red status from master data "Applications".
    All sheets should be in Table format.
    Any help will really help me a lot. Thanks in Advance.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    There are two ways you could do this. The first way would be to run a macro manually by clicking a button on the APPLICATIONS sheet each time you want to update the data. Another way would be to automatically update the data one row at a time as each row of data is added to the APPLICATIONS sheet and the status is inserted into column X. The advantage to this approach is that you would not have to run any macro manually. The update would be automatic. Which approach would work best for you? Also, attach another version of the file which has data in the other columns. This would make testing a possible solution easier.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    Thank you for you quick reply.
    Very much surprised on your second approach ("automatically update the data one row at a time as each row of data is added to the APPLICATIONS sheet and the status is inserted into column X.")

    I have updated/added the second sheet.

    Thanks and Regards,
    Sanjay Kumar-

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try the attached file. The macro is triggered after you enter the status in column X and press the RETURN key. It is important that the status in column X be the last column to be populated. Therefore, enter all the data for columns A to W, then the data in columns Y to AA and lastly the status in column X.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    Thank You for your Support However having some problem in it.
    1. Whenever i am starting to do the entry in Application sheet a pop window is coming.
    2.After completing the entry in X Column the data populated in another sheet are coming out of excel table.
    3. When we changed the status of X column in Application sheet it is not updating (like if we change the status of Screening pending to Joined then from Screening pending sheet it should be deleted and Added to Joined Sheet.)

  6. #6
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    What do you want now? Apart from that it is a bad idea to put data on different tabs.

    Maybe so?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try the attached file.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi mumps1 (Forum Expert)
    It almost doing the same thing which was my requirement.
    Only problem is whenever i selected any row or multiple row from the master data (Application sheet) for deletion or copy paste the data in the master data (Application sheet) . It is showing run time error.
    And when the status of data is going to another sheet , only 1st row is coming into the excel table format and rest of data coming into next to table Line.
    I am attaching with very few entries , so that you can test it

    Hope you will help me in this , as you have done the impossible thing for me.
    Thank you so much and I am just waiting for your response.
    And Yes , as tagged you are an EXPERT.
    Attached Files Attached Files
    Last edited by sanjay.k; 06-21-2020 at 04:32 AM.

  9. #9
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Vraag,
    Thanks for your time and support.
    The Code is just doing the reverse/opposite which was my requirement.

    The Application sheet is the Master Data.
    1.When we do the entry in Application Sheet (it should not be deleted) from Application sheet and create another sheet based on X Column Status and update the data.
    2. If the another sheet (X column status name) already exists then it will only update the data.
    3.If we change the status of (X Column) of previous data (ex. screening pending to Joined) in Application sheet then It should be update/Add as per new status (Add entry in Joined sheet) and remove entry from (Screening pending) Sheet.
    Example:
    If We add one entry in Application Sheet and Final Status is - Screening Pending, Then One Worksheet with screening pending name will created (if already not exits ) and update the entry from Application sheet. If Worksheets name already exist then only update the entry.
    Now if we change the old entry in Application sheet and for example Screening Pending changes to Joined status in X Column then,
    that specific entry will be deleted from "Screening Pending" worksheet and added to "Joined" worksheet.

    Hope I am able to clarify you.

  10. #10
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try the attached version. The error when deleting or copying rows should now be fixed. The macro works in the following manner:
    In the APPLICATION sheet:
    - If you add any new status, the new sheet will be created and the row of data will be copied to it.
    - If you change any existing status to a name that does not have an existing corresponding sheet, the new sheet will be created and the row of data will be moved to the new sheet.
    - If you change any existing status to a name that has an existing corresponding sheet, the row of data will be moved to the existing corresponding sheet.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    HI,
    The error are still coming when we select the whole Row Like (B4 to X4) or multiple or single row with X".
    Once any selection with X Column or Row then Error showing same as previous .
    Also data are going to another sheet (1st entry in the Table column correctly and after that 2nd entry out of table. Like if we do the "Joined" status 2 times then its 1st entry in Joined sheet is in the table , but 2nd entry is out of the table.

    Except above the macro logic is correct.

    Thanks and Regards,
    Sanjay Kumar

  12. #12
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try this version of the code to fix the error.
    Please Login or Register  to view this content.
    I still don't understand what you mean by:
    Also data are going to another sheet (1st entry in the Table column correctly and after that 2nd entry out of table. Like if we do the "Joined" status 2 times then its 1st entry in Joined sheet is in the table , but 2nd entry is out of the table.
    I tested the macros by adding a new status, changing an existing status to a status that has an existing sheet and changing an existing status to a status with no existing sheet and the macros worked properly. Please explain in detail, step-by-step, what you are doing referring to specific cells, rows, columns and sheets using a few examples from your data. Also, attach an updated file that shows how the macros are not working for you.

  13. #13
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    I have done 2 entries in the Application Sheet . And added one error tab in the sheet with error print screen.


    Thanks and Regards,
    Sanjay Kumar
    Attached Files Attached Files

  14. #14
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try the attached file.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    Thank you for giving me attention , and giving your precious time to me.
    You are really a very helpful person.
    I am receiving still rum time error when selecting X column. and little bit issue in updating the columns.

    Attaching the print screen in the error tab.
    Again thank you for such kind help.

    Hope you still help me


    Thanks and Regards,
    Sanjay Kumar
    Attached Files Attached Files

  16. #16
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Replace the previous Worksheet_SelectionChange macro with this one. That should fix the run time error.
    Please Login or Register  to view this content.
    Which columns in APPLICATIONS are subject to change?

  17. #17
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    If by mistake we Select the whole sheet of (Application Sheet) then below error occurs "run time error 6 overflow.

    For updating the Sheet:
    Any changes made in any row should update in its specific sheet.

    Example : if any cell value changes from A4 to last row "AA" and its Final Status is "Rejected". then In rejected sheet the same changes should update.
    Like if we change/update cell Q 4 date (01 feb 2020 to 01 mar-20) then in the rejected sheet it should also update/change to 01 mar 2020.
    Any changes to any cell should update.

    I am attaching the sheet with print screen for better understanding

    thanks and Regards,
    Sanjay Kumar
    Attached Files Attached Files

  18. #18
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try:
    Please Login or Register  to view this content.
    Please note that you cannot change column A in APPLICATIONS because the macros uses that value as a unique identifier for each row in the sheet. If you must change any value in column A in APPLICATIONS, you can do so, but you will have to manually change the corresponding value in the other sheet for the corresponding row.
    Last edited by Mumps1; 06-22-2020 at 08:07 AM.

  19. #19
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    This Code is not working. and After doing the entry in Application sheet , nothing is happening.

  20. #20
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    It's working for me. Try the attached file.
    Attached Files Attached Files

  21. #21
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    I have attached the error screen.
    Attached Files Attached Files

  22. #22
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Look in column X in the row that you are changing. Does the sheet named according to column X exist?

  23. #23
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,

    I am try to express my requirement in more simple way.

    The Application Sheet is the Master Data.
    Requirement :
    Filter the data based on Final status "X" Column and paste the data into its specific sheet in table form.
    Like if the Filter data in Final status is "Screening Pending" then data will be paste in "Screening Pending" Sheet.


    I have made one macro to update the "Screening Pending" Sheet , however its not Dynamic and works only for Screening Pending.
    Also i have to run macro again and Again for this for every entry, So Automatic update in its Specific sheet are highly need.

    Thanks and Regards,
    Sanjay
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    I think now the changes are doing fine.
    But New entries in the Application sheet is not taking and giving the error.

  25. #25
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    I just realized what the problem is. Replace this code:
    Please Login or Register  to view this content.
    with this:
    Please Login or Register  to view this content.

  26. #26
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    You are very close to it .
    Now the addition and changes are doing ,

    The changes are going to correct sheet, however the status name is not changing.
    I have made last entry, as joined status.
    It is correctly created one sheet as "Joined", when i have changed the status to Interview Select, it moves to interview select,
    however the final status in Interview Select sheet is showing as Joined.
    If you see in Interview Select sheet the Final status is showing as joined. It moves to the correct sheet only the status should be "Interview Select"

    Now I Think it is just a moment and you crack it , It will give me very helpful
    Attaching the sheet for your reference.

    thanks and Regards,
    Sanjay Kumar
    Attached Files Attached Files
    Last edited by sanjay.k; 06-22-2020 at 01:14 PM.

  27. #27
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Try:
    Please Login or Register  to view this content.

  28. #28
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    Same problem.
    Added correct sheet and entry moved to correct sheet
    But the final status is not changing and its previous status is showing.
    Done only one entry and attaching for your reference.
    I have done one entry and final status is Joined
    When i changed from Joined to Interview Select then it moves to Interview Select sheet
    But the status is still showing as joined in Interview Select Sheet.
    Attached Files Attached Files

  29. #29
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Let's give it another try:
    Please Login or Register  to view this content.

  30. #30
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    I think Its working fine!
    I will test it more and hopefully it will work fine. If not I will be back for your help.

    You are really genius , You made code so fast , I can't imagine.
    I don't know i will be able to have knowledge like you. very Impressive and very helpful.

    Thank You So much.
    I want to be connected with You...

  31. #31
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    My pleasure.

  32. #32
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    Can you help me once more !
    If I want to having macro as you suggested 2 way.
    1. Every time run the Macro.

    can you make the macro from button click "Every time " when we want to extract the data to its respective sheet.
    I actually want to analyze which will be easy and convenient , where chances of error is less.

    Requirement :
    It Filter the data based on Final status "X" Column and paste the data into its specific sheet in table form. (If sheet name was not then create and Paste the data)

    Thanks and Regards,
    Sanjay Kumar

  33. #33
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    The method I suggested is the easiest and most convenient way to achieve what you want. You could make it more fool proof by putting a data validation drop down list in column X where the user could simply click on any cell in column X and select from the drop down list. This would avoid any typographical errors. Using the button method, you would have to decide which status to use as a filter and then have a message box pop up where you would manually enter the desired status. The drop down list method would avoid manual entry altogether. All it would take is one click without having to manually enter data.

  34. #34
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi Mumps1,
    If i am working as new startup in this then it is the best way.
    But when i want to migrate the previous master data in it , i have to cahange it manually each row.
    Like i have 2000 rows in different sheet ,which i was using earlier.
    Now i want to migrate all the data in it, it will not work.

  35. #35
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,821

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Place this macro in a separate module. The macro assumes that after you migrate the previous master data, the workbook will contain only the APPLICATIONS sheet. Run the macro once to create all the new sheets based on column X. Then if you manually add additional rows to that data, the previous method will automatically copy the row to the appropriate sheet.
    Please Login or Register  to view this content.

  36. #36
    Registered User
    Join Date
    06-16-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    59

    Re: Add or Update Worksheets based on Column Status from Master Data to Another Sheet

    Hi,
    When I try to copy and paste (migrate the Data) from different sheet
    Below error showing for our 1st macro:
    Run time error 9.
    Paste till "W" Column will not give any error, If we paste till "X" Column then error is showing.



    After debug and press to reset and then i click the macro for New Module Macro is running.
    Also When after Macro is running the Status sheets are not coming in Table form .
    It is splitting into Simple Sheet.
    I am attaching the Application, Error and some data to migrate for your reference.

    Thanks and Regards,
    Sanjay Kumar
    Attached Files Attached Files
    Last edited by sanjay.k; 06-24-2020 at 03:03 PM.

+ 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: 12-26-2019, 06:45 AM
  2. Replies: 2
    Last Post: 07-06-2018, 11:52 AM
  3. [SOLVED] Create new worksheets from master sheet based on column contents. Only copy certain fields
    By gbt17 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-15-2017, 12:51 PM
  4. VBA to Update status Column based on recent date
    By edkawy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-17-2017, 10:06 AM
  5. Split data into multiple worksheets based upon a column in master worksheet
    By cep3927 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 10:38 AM
  6. Copying (but not deleting) data from a master sheet to multiple worksheets based on Col A
    By SmartBalance in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2013, 03:09 PM
  7. [SOLVED] VBA to create many worksheets from one master sheet based on column value
    By Ironman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2012, 02:47 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