A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Thank you for extending the support.
I wanted to upload the empty template but again my original post was answered. So I though the additional requirement might be asking too much. As you are comfortable to go through the template. I have uploaded the file in the link.
It can be confusing. I will put it briefly of what I am trying to accomplish.
There is a template with five sheets. Sheet1 Coversheet, Sheet2 (code is already available in your post), Sheet3 (the image I shared), Sheet3 is more specific. Sheet4 and 5 are static. For sheet3, I find the unique number in the source file and then apply Category 1 filter get the data if data exists. remove Category 1 apply Category 2 get data if data exists same with Category 3 filter.
For one unique number in sheet3. I apply three to four filters and pull the data into the template.
Filters:
unique number Category 1
clear filters
unique number Category 2
clear filters
unique number Category 3
clear filters
unique number Category 4 (If necessary)
clear filters
I have two scenarios here:
Scenario 1
For a large chunk of unique numbers there is no data available for Sheet3. So the code we have already in place can be used on those unique numbers at a time to populate the templates with each unique number and save them in a folder.
Scenario 2
For about 30% of the unique numbers there will be data available for Sheet3.
I plan to extract those unique numbers from the source workbook. Get the data for Column G, from CSV file using the unique number. Then use that file as wsSource to populate sheet3.
Therefore, apart from filling in sheet2. I also need to fill in the sheet3 based on the category filters for those 30% unique numbers.
First challenge is to populate the CSV data into the source workbook with line breaks. Once I have everything in place. I start to populate the template with a range of numbers instead of inputting one number at a time in the input box and saving it. (I will make sure that the data exist for those input numbers at least in one of the categories for Sheet3).
Like I said before:
I have a source workbook and one column into that source workbook comes form a CSV downloaded from the portal. That information from the CSV goes into the template's Column G:
The data in CSV column Q for each unique numbers will be as shown in the screenshot below. The Column Q CSV entries go into template Column G via wsSource workbook.
I am not able to share the workbook because I have not yet created wsSource with CSV Column Q data. It is hard to create line breaks for 800 unique numbers although a small percentage of rows does not require line breaks..
Original CSV
CSV after Line breaks
After I copy that data from the portal CSV. I need to clean it up and add line breaks. The picture I shared before and the text did not match exactly because I took the example text directly from the portal and template has info relevant to other unique number. Roman numbers also exist in the CSV. e.g 7(c)-V
"and" is already there in the CSV no need to add.
In summary, I have to prepare wsSource workbook with additional row from CSV Column Q to populate the Sheet3. Thereafter, it is just as you written the code before for Sheet2 wsSource to wsOutput with filters.