rjbur
New Member
- Joined
- Nov 8, 2017
- Messages
- 16
Here is my challenge and I am continuing to search the forum for an example, so if there is another useful thread, please point me in that direction.
I have a spreadsheet/workbook that contains two (2) sheets. Lets call them "CRITERIA" and "DATA". I need to perpetrate the DATA into NEW sheets based on the CRITERIA and if the sheet does not exist, create it based on the Header Row in the CRITERIA sheet. If it does exist, then simply add the data to the end of the existing content in the sheet.
DATA contains a long list of... you guessed it, data. Column-A contains "text" or a string. For my example, anything past Column A is along for the ride.
Here is what the CRITERIA sheet might look like:
<colgroup><col><col span="2"></colgroup><tbody>
</tbody>
Now the DATA sheet contains say something like:
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
Note that I have purposely removed the spacing as the Column-A needs to "contain" the letters and not match a word. As long as somewhere in the cell it has the combination of characters, it contains it and the complete ROW needs to be MOVED to another sheet. If nothing matches, then it is not processed and stays in the current sheet.
In the CRITERIA sheet you can see there are now two columns with the headers of CARS and COLOR. When macro finishes I should have two new sheets, one CARS and the other COLOR.
The other twist is that should I add a third column to CRITERIA it should be processed as well. So we have two open dimensions, the size of the elements under each header and the number of headers to be processed against the DATA.
I did not add a no-match row so that it would stay in the DATA sheet...
I have to run, so I will read through this later today to make sure it makes sense.
Thanks for your time,
Rich
I have a spreadsheet/workbook that contains two (2) sheets. Lets call them "CRITERIA" and "DATA". I need to perpetrate the DATA into NEW sheets based on the CRITERIA and if the sheet does not exist, create it based on the Header Row in the CRITERIA sheet. If it does exist, then simply add the data to the end of the existing content in the sheet.
DATA contains a long list of... you guessed it, data. Column-A contains "text" or a string. For my example, anything past Column A is along for the ride.
Here is what the CRITERIA sheet might look like:
A | B | |
1 | CARS | COLOR |
2 | Dodge | Red |
3 | Chevy | Green |
4 | GMC | Blue |
<colgroup><col><col span="2"></colgroup><tbody>
</tbody>
Now the DATA sheet contains say something like:
<colgroup><col><col><col><col></colgroup><tbody> </tbody> |
<colgroup><col><col><col><col></colgroup><tbody>
</tbody>
Note that I have purposely removed the spacing as the Column-A needs to "contain" the letters and not match a word. As long as somewhere in the cell it has the combination of characters, it contains it and the complete ROW needs to be MOVED to another sheet. If nothing matches, then it is not processed and stays in the current sheet.
In the CRITERIA sheet you can see there are now two columns with the headers of CARS and COLOR. When macro finishes I should have two new sheets, one CARS and the other COLOR.
The other twist is that should I add a third column to CRITERIA it should be processed as well. So we have two open dimensions, the size of the elements under each header and the number of headers to be processed against the DATA.
I did not add a no-match row so that it would stay in the DATA sheet...
I have to run, so I will read through this later today to make sure it makes sense.
Thanks for your time,
Rich