Need to write vba code to sort of transpose from a horizontal data set to a vertical data set with an extra piece of data created.
If the table 1 has no data for mon -> sun just skip
Is there an easy way.. I just seem to be way our of my depth here!!
This data set has like 10,000 centres, so doing it by hand will take forever!!!
Thanks in advance
TABLE 1 - Original
[TABLE="width: 1000"]
<colgroup><col><col span="2"><col><col span="10"></colgroup><tbody>[TR]
[TD]ServiceApprovalNumber[/TD]
[TD]RatingsIssued[/TD]
[TD]Last Service Approval Transfer Date[/TD]
[TD]Annual Monday Start Time[/TD]
[TD]Annual Monday End Time[/TD]
[TD]Annual Tuesday Start Time[/TD]
[TD]Annual Tuesday End Time[/TD]
[TD]Annual Wednesday Start Time[/TD]
[TD]Annual Wednesday End Time[/TD]
[TD]Annual Thursday Start Time[/TD]
[TD]Annual Thursday End Time[/TD]
[TD]Annual Friday Start Time[/TD]
[TD]Annual Friday End Time[/TD]
[TD]listing_id[/TD]
[/TR]
[TR]
[TD]SE-00009863[/TD]
[TD="align: right"]Jul-16[/TD]
[TD="align: center"]########[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]155[/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]Jun-14[/TD]
[TD="align: center"]########[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]255[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]New Sheet - TABLE 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ServiceApprovalNumber [/TD]
[TD]listing_id[/TD]
[TD]day[/TD]
[TD]open_time [/TD]
[TD="colspan: 2"]close_time[/TD]
[TD][/TD]
[TD="colspan: 2"]where day[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009863[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]0 = Monday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009864[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]1 = Tuesday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]2 = Wednesday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009866[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009867[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]skip if no hours data[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009866[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009867[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009868[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009869[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
If the table 1 has no data for mon -> sun just skip
Is there an easy way.. I just seem to be way our of my depth here!!
This data set has like 10,000 centres, so doing it by hand will take forever!!!
Thanks in advance
TABLE 1 - Original
[TABLE="width: 1000"]
<colgroup><col><col span="2"><col><col span="10"></colgroup><tbody>[TR]
[TD]ServiceApprovalNumber[/TD]
[TD]RatingsIssued[/TD]
[TD]Last Service Approval Transfer Date[/TD]
[TD]Annual Monday Start Time[/TD]
[TD]Annual Monday End Time[/TD]
[TD]Annual Tuesday Start Time[/TD]
[TD]Annual Tuesday End Time[/TD]
[TD]Annual Wednesday Start Time[/TD]
[TD]Annual Wednesday End Time[/TD]
[TD]Annual Thursday Start Time[/TD]
[TD]Annual Thursday End Time[/TD]
[TD]Annual Friday Start Time[/TD]
[TD]Annual Friday End Time[/TD]
[TD]listing_id[/TD]
[/TR]
[TR]
[TD]SE-00009863[/TD]
[TD="align: right"]Jul-16[/TD]
[TD="align: center"]########[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD="align: right"]155[/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]Jun-14[/TD]
[TD="align: center"]########[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD="align: right"]255[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]New Sheet - TABLE 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]ServiceApprovalNumber [/TD]
[TD]listing_id[/TD]
[TD]day[/TD]
[TD]open_time [/TD]
[TD="colspan: 2"]close_time[/TD]
[TD][/TD]
[TD="colspan: 2"]where day[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009863[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]0 = Monday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009864[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]1 = Tuesday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"]2 = Wednesday[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009866[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009867[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]6:30[/TD]
[TD="align: right"]18:30[/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 3"]skip if no hours data[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009865[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009866[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009867[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009868[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SE-00009869[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]7.45[/TD]
[TD="align: right"]17.45[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]