Hello All,
Just wondering whether anybody can help me with a macro question?
I have two columns of data, for example as follows:
<table border="0" cellpadding="0" cellspacing="0" width="161"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1206;width:25pt" width="33"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td colspan="2" style="height:15.0pt;mso-ignore:colspan; width:73pt" height="20" width="97">Module_code</td> <td style="width:48pt" width="64">Old_topic_code</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR321</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR322</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR323</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR324</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR325</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR326</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR320E</td> <td>
</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR001</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR002</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR003</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR004</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR005</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR002M</td> <td>
</td> <td>GR006</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR002M</td> <td>
</td> <td>GR007</td> </tr> </tbody></table>
I would like to transpose the data, so that all the values in column Old_Topic_Code are detailed in the same row as the relevant module code, for example the output for GR321M and GR322M would be as follows:
<table border="0" cellpadding="0" cellspacing="0" width="353"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1206;width:25pt" width="33"> <col style="width:48pt" span="4" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl65" colspan="2" style="height:15.0pt;mso-ignore: colspan;width:73pt" height="20" width="97">Module_code</td> <td class="xl65" colspan="2" style="mso-ignore:colspan;width:96pt" width="128">Old_topic_code</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR321</td> <td>GR322</td> <td>GR323</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR324</td> <td>GR325</td> <td>GR326</td> <td>
</td> </tr> </tbody></table><table border="0" cellpadding="0" cellspacing="0" height="40" width="349"><tbody><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr></tbody></table>This would then continue down the sheet, and each unique value in column Module_code would then detail the associated Old_topic_code values. As I have thousands of rows of data, the only way I can do this would be a macro, but just not sure how.
All assistance greatly appreciated!
Thanks
quercus
Just wondering whether anybody can help me with a macro question?
I have two columns of data, for example as follows:
<table border="0" cellpadding="0" cellspacing="0" width="161"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1206;width:25pt" width="33"> <col style="width:48pt" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td colspan="2" style="height:15.0pt;mso-ignore:colspan; width:73pt" height="20" width="97">Module_code</td> <td style="width:48pt" width="64">Old_topic_code</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR321</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR322</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR323</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR324</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR325</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR326</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR320E</td> <td>
</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR001</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR002</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR003</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR004</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR001M</td> <td>
</td> <td>GR005</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR002M</td> <td>
</td> <td>GR006</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR002M</td> <td>
</td> <td>GR007</td> </tr> </tbody></table>
I would like to transpose the data, so that all the values in column Old_Topic_Code are detailed in the same row as the relevant module code, for example the output for GR321M and GR322M would be as follows:
<table border="0" cellpadding="0" cellspacing="0" width="353"><colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:1206;width:25pt" width="33"> <col style="width:48pt" span="4" width="64"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl65" colspan="2" style="height:15.0pt;mso-ignore: colspan;width:73pt" height="20" width="97">Module_code</td> <td class="xl65" colspan="2" style="mso-ignore:colspan;width:96pt" width="128">Old_topic_code</td> <td style="width:48pt" width="64">
</td> <td style="width:48pt" width="64">
</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR321M</td> <td>
</td> <td>GR321</td> <td>GR322</td> <td>GR323</td> <td>GR320X</td> </tr> <tr style="height:15.0pt" height="20"> <td style="height:15.0pt" height="20">GR322M</td> <td>
</td> <td>GR324</td> <td>GR325</td> <td>GR326</td> <td>
</td> </tr> </tbody></table><table border="0" cellpadding="0" cellspacing="0" height="40" width="349"><tbody><tr style="height:15.0pt" height="20"><td style="height:15.0pt" height="20">
</td><td>
</td><td>
</td><td>
</td><td>
</td><td>
</td></tr></tbody></table>This would then continue down the sheet, and each unique value in column Module_code would then detail the associated Old_topic_code values. As I have thousands of rows of data, the only way I can do this would be a macro, but just not sure how.
All assistance greatly appreciated!
Thanks
quercus