compare row's if value of corresponding column's not equal insert them

i have two grouped of columns.one of them is subset of another.i want to write a macro compare them and if they were not equal insert second one to first one. algorithm ode:

if (code-1)<>(code-2) AND (serial-1)<>(serial-2) AND (amount-1)<>(amount-2) then
 (code-1)==(code-2) AND (serial-1)==(serial-2) AND (amount-1)==(amount-2)

and i want inserted row be marked.

the table i have is like below:

code-1  serial-1    amount-1    code-2  serial-2    amount-2
1         11          111          1      11          111
3         33          333          1      11           11
                                   2      22           22
                                   3      33           33
                                   3      33          333

the result i looking for is below:

code-1  serial-1    amount-1    code-2  serial-2    amount-2
   1     11           111          1      11          111
   3     33           333          1      11          11
   1     11           11           2      22          22
   2     22           22           3      33          33
   3     33           33           3      33         333

March 16th, 2015 7:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics