Hi -
Fig. 1 below shows what I am trying create in Excel using a marcos. Rows that are populated in Columns A-D are primary records. Rows populated in Columns E-H are the secondary records appended to the primary. A row/space is added under the primary records starting with the 2nd secondary record.
Fig. 1
<TBODY>
</TBODY>
The data comes from a table where every row is a primary or secodary record, as per Fig. 2 below.
Fig. 2
<TBODY>
</TBODY>
Every column B (EFFDT) change is a primary record. Secondary records need to be appended/merged to the side of the primary record like in the Fig. 1.
How then do I create a macros to append or merge the secondary records for each EFFDT change and insert the correct # of row/space below the primary records? Hopefully this all makes sense....
Fig. 1 below shows what I am trying create in Excel using a marcos. Rows that are populated in Columns A-D are primary records. Rows populated in Columns E-H are the secondary records appended to the primary. A row/space is added under the primary records starting with the 2nd secondary record.
Fig. 1
A | B | C | D | E | F | G | H |
ID | EFFDT | ACTION | ANNUAL_RT | EFFDT | ACTION | COMPRATE | CD |
AX1234 | 01-01-10 | PRO | 200 | 01-01-10 | PRO | 10 | FLXPCT |
AX1234 | 01-01-10 | PRO | 60 | LUNCH | |||
AX1234 | 01-04-10 | MER | 300 | 01-04-10 | MER | 20 | FLXPCT |
AX1234 | 01-04-10 | MER | 60 | LUNCH |
<TBODY>
</TBODY>
The data comes from a table where every row is a primary or secodary record, as per Fig. 2 below.
Fig. 2
A | B | C | D | E |
ID | EFFDT | ACTION | ANNUAL_RT | CD |
AX1234 | 01-01-10 | PRO | 200 | ANNUAL |
AX1234 | 01-01-10 | PRO | 10 | FLXPCT |
AX1234 | 01-01-10 | PRO | 60 | LUNCH |
AX1234 | 01-04-10 | MER | 300 | ANNUAL |
<TBODY>
</TBODY>
Every column B (EFFDT) change is a primary record. Secondary records need to be appended/merged to the side of the primary record like in the Fig. 1.
How then do I create a macros to append or merge the secondary records for each EFFDT change and insert the correct # of row/space below the primary records? Hopefully this all makes sense....