Hi all, I need help in structuring a lot of data file and I was wondering If anyone could help me.
what I want is to search for cell that starts with "CP" in range (A:A) then copy the next set of row untill the next "CP" and paste(transpose).
This is how the data is at the moment:
[TABLE="width: 129"]
<tbody>[TR]
[TD]CP,00001[/TD]
[/TR]
[TR]
[TD]Date,15/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]85[/TD]
[/TR]
[TR]
[TD="align: right"]24[/TD]
[/TR]
[TR]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD="align: right"]1485[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]87[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,00502[/TD]
[/TR]
[TR]
[TD]Date,14/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]69[/TD]
[/TR]
[TR]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD="align: right"]78.6[/TD]
[/TR]
[TR]
[TD="align: right"]36.9[/TD]
[/TR]
[TR]
[TD="align: right"]85.8[/TD]
[/TR]
[TR]
[TD="align: right"]8569.5[/TD]
[/TR]
[TR]
[TD="align: right"]78.9[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]874[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,04003[/TD]
[/TR]
[TR]
[TD]Date,19/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]52[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD="align: right"]47[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]69[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]CP,90004[/TD]
[/TR]
[TR]
[TD]Date,16/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD="align: right"]7.3[/TD]
[/TR]
[TR]
[TD="align: right"]3.6[/TD]
[/TR]
[TR]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[/TR]
[TR]
[TD]CP,00035[/TD]
[/TR]
[TR]
[TD]Date,1/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]78.6[/TD]
[/TR]
[TR]
[TD="align: right"]36.9[/TD]
[/TR]
[TR]
[TD="align: right"]85.8[/TD]
[/TR]
[TR]
[TD="align: right"]8569.5[/TD]
[/TR]
[TR]
[TD="align: right"]78.9[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]874[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD]CP,99006[/TD]
[/TR]
[TR]
[TD]Date,12/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]87[/TD]
[/TR]
[TR]
[TD="align: right"]96[/TD]
[/TR]
[TR]
[TD="align: right"]66[/TD]
[/TR]
[TR]
[TD="align: right"]55[/TD]
[/TR]
</tbody>[/TABLE]
and I want it to be in this form
[TABLE="width: 844"]
<tbody>[TR]
[TD]CP,00001[/TD]
[TD]Date,15/06/2014[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]85[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]1485[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]101[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CP,00502[/TD]
[TD]Date,14/06/2014[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]69[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]78.6[/TD]
[TD="align: right"]36.9[/TD]
[TD="align: right"]85.8[/TD]
[TD="align: right"]8570[/TD]
[TD="align: right"]78.9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]874[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,04003[/TD]
[TD]Date,19/06/2014[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]52[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]69[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CP,90004[/TD]
[TD]Date,16/06/2014[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]7.3[/TD]
[TD="align: right"]3.6[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]58[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]21[/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]CP,00035[/TD]
[TD]Date,1/06/2014[/TD]
[TD="align: right"]78.6[/TD]
[TD="align: right"]36.9[/TD]
[TD="align: right"]85.8[/TD]
[TD="align: right"]8570[/TD]
[TD="align: right"]78.9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]874[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CP,99006[/TD]
[TD]Date,12/06/2014[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]96[/TD]
[TD="align: right"]66[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]87[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I will be very grateful if some one could help me with the VBA code for this.
Thanks in advance
what I want is to search for cell that starts with "CP" in range (A:A) then copy the next set of row untill the next "CP" and paste(transpose).
This is how the data is at the moment:
[TABLE="width: 129"]
<tbody>[TR]
[TD]CP,00001[/TD]
[/TR]
[TR]
[TD]Date,15/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]85[/TD]
[/TR]
[TR]
[TD="align: right"]24[/TD]
[/TR]
[TR]
[TD="align: right"]32[/TD]
[/TR]
[TR]
[TD="align: right"]1485[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]101[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]87[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,00502[/TD]
[/TR]
[TR]
[TD]Date,14/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]69[/TD]
[/TR]
[TR]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD="align: right"]78.6[/TD]
[/TR]
[TR]
[TD="align: right"]36.9[/TD]
[/TR]
[TR]
[TD="align: right"]85.8[/TD]
[/TR]
[TR]
[TD="align: right"]8569.5[/TD]
[/TR]
[TR]
[TD="align: right"]78.9[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]874[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,04003[/TD]
[/TR]
[TR]
[TD]Date,19/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD="align: right"]52[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD="align: right"]47[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]69[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[/TR]
[TR]
[TD]CP,90004[/TD]
[/TR]
[TR]
[TD]Date,16/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD="align: right"]7.3[/TD]
[/TR]
[TR]
[TD="align: right"]3.6[/TD]
[/TR]
[TR]
[TD="align: right"]36[/TD]
[/TR]
[TR]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[/TR]
[TR]
[TD]CP,00035[/TD]
[/TR]
[TR]
[TD]Date,1/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]78.6[/TD]
[/TR]
[TR]
[TD="align: right"]36.9[/TD]
[/TR]
[TR]
[TD="align: right"]85.8[/TD]
[/TR]
[TR]
[TD="align: right"]8569.5[/TD]
[/TR]
[TR]
[TD="align: right"]78.9[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]874[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[/TR]
[TR]
[TD]CP,99006[/TD]
[/TR]
[TR]
[TD]Date,12/06/2014[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD="align: right"]87[/TD]
[/TR]
[TR]
[TD="align: right"]96[/TD]
[/TR]
[TR]
[TD="align: right"]66[/TD]
[/TR]
[TR]
[TD="align: right"]55[/TD]
[/TR]
</tbody>[/TABLE]
and I want it to be in this form
[TABLE="width: 844"]
<tbody>[TR]
[TD]CP,00001[/TD]
[TD]Date,15/06/2014[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]85[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]1485[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]101[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD]CP,00502[/TD]
[TD]Date,14/06/2014[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]69[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]78.6[/TD]
[TD="align: right"]36.9[/TD]
[TD="align: right"]85.8[/TD]
[TD="align: right"]8570[/TD]
[TD="align: right"]78.9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]874[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD]CP,04003[/TD]
[TD]Date,19/06/2014[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]52[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]69[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CP,90004[/TD]
[TD]Date,16/06/2014[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]7.3[/TD]
[TD="align: right"]3.6[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]58[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]21[/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]CP,00035[/TD]
[TD]Date,1/06/2014[/TD]
[TD="align: right"]78.6[/TD]
[TD="align: right"]36.9[/TD]
[TD="align: right"]85.8[/TD]
[TD="align: right"]8570[/TD]
[TD="align: right"]78.9[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]874[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CP,99006[/TD]
[TD]Date,12/06/2014[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]96[/TD]
[TD="align: right"]66[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]87[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I will be very grateful if some one could help me with the VBA code for this.
Thanks in advance