Michael151
Board Regular
- Joined
- Sep 20, 2010
- Messages
- 247
Hello all,
Need help writing a macro that will move data in one specific column and row to another sheet based on the header in row 1.
The columns that need to be moved are:
Library
Deal_Date
Title
This is sheet 1:
<table border="0" cellpadding="0" cellspacing="0" width="348"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl26" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">3</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">4</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">5</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">6</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">7</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">8</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">9</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">10</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> </tbody></table>
This is sheet2:
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">2</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title2</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">3</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">02-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title3</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">4</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">03-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title4</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">5</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">04-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title5</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">6</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">7</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">06-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title7</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">8</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">07-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title8</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">9</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">08-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title9</td> </tr> </tbody></table>
At the end of sheet 1 (row 11 in this case), I need to move the data in sheet 2 into sheet 1, keeping the data across each row just as it is in sheet 2.
After running the macro, the sheet will look like this:
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">2</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">3</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">4</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">5</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">6</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">7</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">8</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">9</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">10</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">12</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">13</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">02-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">14</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">03-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">15</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">04-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">16</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">17</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">06-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title7</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">18</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">07-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title8</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">19</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">08-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title9</td> </tr> </tbody></table>
I'd like to use the headers in row 1 as the unique identifiers for each column. The macro will need to identify the last row of data across all columns in sheet 1, then insert the data from sheet 2 in the corresponding columns, beginning with row 2 in sheet 2. Will need to loop through several thousand rows. Must keep data being moved from sheet 2 to sheet 1 in the same row.
Any help would be most appreciated - thank you!!
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">
</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> </tbody></table>
Need help writing a macro that will move data in one specific column and row to another sheet based on the header in row 1.
The columns that need to be moved are:
Library
Deal_Date
Title
This is sheet 1:
<table border="0" cellpadding="0" cellspacing="0" width="348"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl26" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl26" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">3</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">4</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">5</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">6</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">7</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">8</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">9</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">10</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl25" style="height: 12.75pt; border-top: medium none;" align="right" height="17">11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl28" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" align="right" width="64">2</td> <td class="xl27" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> </tbody></table>
This is sheet2:
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">2</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title2</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">3</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">02-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title3</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">4</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">03-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title4</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">5</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">04-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title5</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">6</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">7</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">06-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title7</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">8</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">07-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title8</td> </tr> <tr style="height: 25.5pt;" height="34"> <td class="xl27" style="height: 25.5pt; border-top: medium none;" align="right" height="34">9</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">08-Feb-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title9</td> </tr> </tbody></table>
At the end of sheet 1 (row 11 in this case), I need to move the data in sheet 2 into sheet 1, keeping the data across each row just as it is in sheet 2.
After running the macro, the sheet will look like this:
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">1</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">library</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">Deal_Date</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">Title</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">2</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">3</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">4</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">5</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">6</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">7</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">8</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">9</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">10</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">W</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Jan-11</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title1</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">12</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">01-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">13</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">02-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title3</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">14</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">03-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title4</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">15</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">04-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title5</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">16</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">17</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">06-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title7</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">18</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">07-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title8</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">19</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">L</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">08-Feb-11</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">Title9</td> </tr> </tbody></table>
I'd like to use the headers in row 1 as the unique identifiers for each column. The macro will need to identify the last row of data across all columns in sheet 1, then insert the data from sheet 2 in the corresponding columns, beginning with row 2 in sheet 2. Will need to loop through several thousand rows. Must keep data being moved from sheet 2 to sheet 1 in the same row.
Any help would be most appreciated - thank you!!
<table border="0" cellpadding="0" cellspacing="0" width="284"><col style="width: 48pt;" width="64" span="2"> <col style="width: 69pt;" width="92"> <col style="width: 48pt;" width="64"> <tbody><tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; width: 48pt;" align="right" width="64" height="17">
</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl28" style="border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl28" style="border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl30" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl29" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl27" style="height: 12.75pt; border-top: medium none;" align="right" height="17">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> <td class="xl32" style="border-top: medium none; border-left: medium none; width: 69pt;" width="92">
</td> <td class="xl31" style="border-top: medium none; border-left: medium none; width: 48pt;" width="64">
</td> </tr> </tbody></table>
Last edited: