Converting Data from one Column into multiple rows

silkupo

New Member
Joined
Sep 18, 2011
Messages
2
Hi all

Can someone please teach me how I can convert data from a column into a row? Basically I have regression outputs that are exported from a text format which look something like this :




<table border="0" cellpadding="0" cellspacing="0" width="264"><col style="mso-width-source:userset;mso-width-alt:2925;width:60pt" width="80"> <col style="mso-width-source:userset;mso-width-alt:3510;width:72pt" width="96"> <col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88"> <tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:60pt" height="20" width="80">Variable</td> <td style="width:72pt" width="96">Coeff</td> <td style="width:66pt" width="88">Std Error</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">**************</td> <td>*************</td> <td>*************</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">1. Mean(1)</td> <td align="right">0.0424234</td> <td align="right">0.011516468</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">2. Mean(2)</td> <td align="right">0.03833762</td> <td align="right">0.015204564</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">3. Mean(3)</td> <td align="right">0.057602779</td> <td align="right">0.02190734</td> </tr> </tbody></table>


<table border="0" cellpadding="0" cellspacing="0" width="264"><tbody><tr height="20"><tr style="height:15.0pt" height="20"><td style="height:15.0pt;width:60pt" height="20" width="80">Variable</td><td style="width:72pt" width="96">Coeff</td><td style="width:66pt" width="88">Std Error</td></tr><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">*************</td><td>*************</td><td>*************</td></tr><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">1. Mean(1)</td><td align="right">0.0424234</td><td align="right">0.011516468</td></tr><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">2. Mean(2)</td><td align="right">0.03833762</td><td align="right">0.015204564</td></tr><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">3. Mean(3)</td><td align="right">0.057602779</td><td align="right">0.02190734</td></tr></tr></tbody></table>
i have about 500 of these outputs aligned in a column, but what I'm trying to do is to align them into rows like this:


<table border="0" cellpadding="0" cellspacing="0" width="256"><col style="width:48pt" span="4" width="64"> <tbody><tr style="height:15.0pt" height="20"> <td style="height:15.0pt;width:48pt" height="20" width="64">
</td> <td style="width:48pt" width="64">Mean(1)</td> <td style="width:48pt" width="64">Mean(2)</td> <td style="width:48pt" width="64">Mean(3)</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">output1</td> <td>a</td> <td>b</td> <td>c</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">output2</td> <td>d</td> <td>e</td> <td>f</td> </tr> </tbody></table>
Is it possible for me to design a macro that will grab those particular 3 cells in the column and put them into rows?

Thanks in advance, I appreciate the help!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Is that data all in column A, one row of info per row as shown?

Or is the data shown in column A:C, one row of info as shown?

Is there exactly 3 empty rows between each "set" of data?
 
Upvote 0
Hi,

Thanks for your help, I have got a friend of mine to help me with fixing it!! works like a charm now
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,853
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top