Hi Everyone,
I am new to writing macros.
I am trying to figure out a macro to cut a specific cell and the next 9 cells to a new row.
Tried the macro recorder but don't know how to get it to continue to the end of the row until there is no more data.
The scenario is a sheet with 1 row that contains hundreds of columns with data.
In that row, there is a "common text" in a cell and then 9 more cells of data, and this pattern reoccurs.
The worksheet before:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]text[/TD]
[TD]data1[/TD]
[TD]data2[/TD]
[TD]data3[/TD]
[TD]data4[/TD]
[TD]data5[/TD]
[TD]data6[/TD]
[TD]data7[/TD]
[TD]data8[/TD]
[TD]data9[/TD]
[TD]text[/TD]
[TD]data10[/TD]
[TD]data11[/TD]
[TD]data12[/TD]
[/TR]
</tbody>[/TABLE]
In a new Worksheet after macro:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]text[/TD]
[TD]data1[/TD]
[TD]data2[/TD]
[TD]data3[/TD]
[TD]data4[/TD]
[TD]data5[/TD]
[TD]data6[/TD]
[TD]data7[/TD]
[TD]data8[/TD]
[TD]data9[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]text[/TD]
[TD]data10[/TD]
[TD]data11[/TD]
[TD]data12[/TD]
[TD]data13[/TD]
[TD]data14[/TD]
[TD]data15[/TD]
[TD]data16[/TD]
[TD]data17[/TD]
[TD]data18[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]text[/TD]
[TD]data19[/TD]
[TD]data20[/TD]
[TD]data21[/TD]
[TD]data22[/TD]
[TD]data23[/TD]
[TD]data24[/TD]
[TD]data25[/TD]
[TD]data26[/TD]
[TD]data27[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated!
Thanks,
Stan
I am new to writing macros.
I am trying to figure out a macro to cut a specific cell and the next 9 cells to a new row.
Tried the macro recorder but don't know how to get it to continue to the end of the row until there is no more data.
The scenario is a sheet with 1 row that contains hundreds of columns with data.
In that row, there is a "common text" in a cell and then 9 more cells of data, and this pattern reoccurs.
The worksheet before:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]text[/TD]
[TD]data1[/TD]
[TD]data2[/TD]
[TD]data3[/TD]
[TD]data4[/TD]
[TD]data5[/TD]
[TD]data6[/TD]
[TD]data7[/TD]
[TD]data8[/TD]
[TD]data9[/TD]
[TD]text[/TD]
[TD]data10[/TD]
[TD]data11[/TD]
[TD]data12[/TD]
[/TR]
</tbody>[/TABLE]
In a new Worksheet after macro:
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]text[/TD]
[TD]data1[/TD]
[TD]data2[/TD]
[TD]data3[/TD]
[TD]data4[/TD]
[TD]data5[/TD]
[TD]data6[/TD]
[TD]data7[/TD]
[TD]data8[/TD]
[TD]data9[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]text[/TD]
[TD]data10[/TD]
[TD]data11[/TD]
[TD]data12[/TD]
[TD]data13[/TD]
[TD]data14[/TD]
[TD]data15[/TD]
[TD]data16[/TD]
[TD]data17[/TD]
[TD]data18[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]text[/TD]
[TD]data19[/TD]
[TD]data20[/TD]
[TD]data21[/TD]
[TD]data22[/TD]
[TD]data23[/TD]
[TD]data24[/TD]
[TD]data25[/TD]
[TD]data26[/TD]
[TD]data27[/TD]
[/TR]
</tbody>[/TABLE]
Any help would be appreciated!
Thanks,
Stan