A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Your Comments: And I tried to implement progress bar in Scenario 1 code
I imported the form into the macro
Both Scenario 1 code and Scenario 2 code are integrated into the one project. Both Scenarios run one after the other and produce the full Output Workbooks. Therefore, importing the Userform into an earlier version of the code will not work because many changes have been made since Scenario 1. Simply use the new code macro as is.
- The modified code has only been done for the Progress Bar project example.
- Code modified to work with the new Category codes.
- Valid Category Codes in a lookup table on Main Menus sheet. Additional categories can be added but then additional examples of the headers will be required in Categories Templates.
- First up the code validates all of the category codes in wsSource.xlsx against the table in columns Q:R of main Menu sheet.
- If any codes in wsSource are not found in the Lookup table then the user is notified so that they need to be fixed in the source file. The code copies the Category codes from wsSource to Column "E" in Unique Lists worksheet and "Remove duplicates" is applied to the list. Then the code loops through the Unique List and tests if they are in the Lookup Table on Main Menu Sheet. If any do not exist in the Lookup then "Invalid" is inserted in column "F" and the code halts with a message to the user who must then fix the codes in the Source Data file.
- Suggest for testing to change some Category codes in the source file so they do not match the table in Main Menu and then run the code and observe result with instructions to correct the source data.
- It is essential to ensure that only valid Category Codes appear in the wssource data otherwise you will run into problems with missing data.
The initial "Create Output Workbooks" button has been left on Main Menu but you will see that it opens the Userform and then the code is run from the button on the Userform. If you want then you can delete the button on Main Menu and then go to ThisWorkbook VBA module and un-comment the code "Call ShowUserform" and the Userform will automatically open when the workbook is opened.
After testing you might want to apply your artistic abilities to create an artistic Main Menu worksheet and userform etc that contains your work logo etc but I will leave that to you.
Feel free to get back to me if any more questions.
I am hoping after this exercise that you will appreciate the importance of "System Analysis". This is a process of getting the Users and Programmers together and work out exactly what is required for the system. It should take into account the source data plus examples of how the data is to be presented after automating. In addition it should take into account how the initial data will be entered together with how it can be validated at the earliest stage. In fact, the "System Analysis" normally is some 80% of the cost of the project and the actual writing of the code is the easy part once the programmer fully understands what is required.
Latest copy of the workbooks with the code at the following link. Note that wsSource.xlsx is now named wsSource2.xlsx because I have changed the categories to match the latest categories that you provided.