Michael151
Board Regular
- Joined
- Sep 20, 2010
- Messages
- 247
Hello all,
Trying to write a macro that will move data from one column into another column based on the headers in row 1. I have two columns (RNotes and GNotes). These columns are not always next to each other, which is why I’d like to use the header in row 1 to identify. The data in GNotes needs to move into RNotes separated by a space.
In the example below, the data in GNotes moves into RNotes and notes1 and Notes2 are separated by a space in the cell in the RNotes column.
Before:
<table border="0" cellpadding="0" cellspacing="0" width="192"><col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">RNotes</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">GNotes</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> </tbody></table>
After:
<table border="0" cellpadding="0" cellspacing="0" width="192"><col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">RNotes</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">GNotes</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> </tbody></table>
Help is appreciated - thank you!
<table border="0" cellpadding="0" cellspacing="0" width="128"><col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr></tbody></table>
Trying to write a macro that will move data from one column into another column based on the headers in row 1. I have two columns (RNotes and GNotes). These columns are not always next to each other, which is why I’d like to use the header in row 1 to identify. The data in GNotes needs to move into RNotes separated by a space.
In the example below, the data in GNotes moves into RNotes and notes1 and Notes2 are separated by a space in the cell in the RNotes column.
Before:
<table border="0" cellpadding="0" cellspacing="0" width="192"><col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">RNotes</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">GNotes</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> <tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt;" height="17">notes1</td> <td>
</td> <td>Notes2</td> </tr> </tbody></table>
After:
<table border="0" cellpadding="0" cellspacing="0" width="192"><col style="width: 48pt;" width="64" span="3"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">RNotes</td> <td style="width: 48pt;" width="64">
</td> <td style="width: 48pt;" width="64">GNotes</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">notes1 Notes2</td> <td>
</td> </tr> </tbody></table>
Help is appreciated - thank you!
<table border="0" cellpadding="0" cellspacing="0" width="128"><col style="width: 48pt;" width="64" span="2"> <tbody><tr style="height: 12.75pt;" height="17"> <td style="height: 12.75pt; width: 48pt;" width="64" height="17">
</td> <td style="width: 48pt;" width="64">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr><tr style="height: 12.75pt;" height="17"><td colspan="2" style="height: 12.75pt;" height="17">
</td></tr></tbody></table>