<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]Date[/TD]
[TD="align: right"]Time[/TD]
[TD="align: right"]Yes/No[/TD]
[TD="align: right"]Price[/TD]
[TD="align: right"]Colour[/TD]
[TD="align: right"]Amount[/TD]
[TD="align: right"]Number[/TD]
[TD="align: right"]Day[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]16/09/2014[/TD]
[TD="align: right"]10:18:54[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23415[/TD]
[TD="align: right"]Red[/TD]
[TD="align: right"]41995[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]Monday[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]16/09/2014[/TD]
[TD="align: right"]10:18:53[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23410[/TD]
[TD="align: right"]Yellow[/TD]
[TD="align: right"]20967[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]Monday[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]16/09/2014[/TD]
[TD="align: right"]10:18:54[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23410[/TD]
[TD="align: right"]Yellow[/TD]
[TD="align: right"]20967[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]Tuesday[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]16/09/2014[/TD]
[TD="align: right"]10:18:55[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23415[/TD]
[TD="align: right"]Red[/TD]
[TD="align: right"]27563[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]Wednesday[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]16/09/2014[/TD]
[TD="align: right"]10:19:02[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23410[/TD]
[TD="align: right"]Yellow[/TD]
[TD="align: right"]26952[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]Monday[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]20/07/2015[/TD]
[TD="align: right"]13:25:17[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23415[/TD]
[TD="align: right"]Red[/TD]
[TD="align: right"]36031[/TD]
[TD="align: right"]2.2[/TD]
[TD="align: right"]Monday[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]20/07/2015[/TD]
[TD="align: right"]13:25:17[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]Blue[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]2.4[/TD]
[TD="align: right"]Tuesday[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]20/07/2015[/TD]
[TD="align: right"]13:25:18[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23410[/TD]
[TD="align: right"]Yellow[/TD]
[TD="align: right"]20967[/TD]
[TD="align: right"]2.6[/TD]
[TD="align: right"]Wednesday[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]20/07/2015[/TD]
[TD="align: right"]13:25:19[/TD]
[TD="align: right"]No[/TD]
[TD="align: right"]23415[/TD]
[TD="align: right"]Red[/TD]
[TD="align: right"]36031[/TD]
[TD="align: right"]2.8[/TD]
[TD="align: right"]Monday[/TD]
</tbody>
So this is an example of a data table am am using. I want the Macro to be flexible. So if Select the Colour cell(E1). I want it to create 3 worksheets Red, Yellow and Blue and contain the rows of data for that colour.
I then may want to use it on the Day cell(H1) It would then create separate worksheets for Monday, Tuesday and Wednesday.
So whatever Column header I select I want it to create a worksheet that splits up the values of that column
............
This is would be the example once run. I am currently on the Blue worksheet
| A | B | C | D | E | F | G | H |
---|
Date | Time | Yes/No | Price | Colour | Amount | Number | Day | |
No | Blue | Tuesday | | | | | | |
No | Blue | Tuesday | | | | | | |
No | Blue | Wednesday | | | | | | |
No | Blue | Wednesday | | | | | | |
No | Blue | Monday | | | | | | |
No | Blue | Wednesday | | | | | | |
No | Blue | Wednesday | | | | | | |
No | Blue | Monday | | | | | | |
No | Blue | Monday | | | | | | |
<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559225[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]2.4[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559271[/TD]
[TD="align: right"]23433[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]3.2[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.55934[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]3.4[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559387[/TD]
[TD="align: right"]23433[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]4.2[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559456[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]4.6[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559502[/TD]
[TD="align: right"]23433[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]5[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559572[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]5.8[/TD]
[TD="align: center"]9[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559618[/TD]
[TD="align: right"]23433[/TD]
[TD="align: right"]19281[/TD]
[TD="align: right"]6.2[/TD]
[TD="align: center"]10[/TD]
[TD="align: right"]########[/TD]
[TD="align: right"]0.559688[/TD]
[TD="align: right"]23430[/TD]
[TD="align: right"]19282[/TD]
[TD="align: right"]6.8[/TD]
</tbody>