I have 2 sets of three grouped columns in one worksheet. This stretches for 30000 rows. Sample data is below:

code(1) serial(1) amount(1) code(2) serial(2) amount(2)
1 11 100 1 1000 1000
1 12 200 2 2000 2000
1 13 100 3 3000 3000
2 14 100 4 4000 4000
2 15 100 5 5000 5000
3 16 100 6 6000 6000


Some of first code column values are repeated in the second code column but in a disordered fashion. I want to match the second code column values to the first and update the Serial and Amount values based on the match. The best way I can describe the logic would be:

IF(Code(1)==Code(2))
THEN
(Amount(1)==Amount(2))
and
(Serial(1)==Serial(2))



as you see in example code(2) column we have three repeated 1 value but in code(1) column we have just one 1 .i want to excel update serial amount in 1th row if matched for other 2 time's does not exist any 1 in code(1) insert serial(2) amount(2) code(2) as a new row in serial(1) amount(1)code(1) i trying below code it update unique code but it cant insert repeated code like second and third 1 with it's serial and amount.

Sub checklist()
Dim LastRow AsLong
With ActiveSheet
LastRow =.Cells(.Rows.Count,"A").End(xlUp).Row
EndWith

Dim cell As Range
ForEach cell In Range("a1:a"& LastRow)
ForEach cell2 In Range("D1:D"& LastRow)

If cell.Offset(0,0)<>""And cell.Offset(0,0)= cell2.Offset(0,0)Then
cell2.Offset(0,0)= cell.Offset(0,0)
cell2.Offset(0,1)= cell.Offset(0,1)
cell2.Offset(0,2)= cell.Offset(0,2)

EndIf
Next
Next
Next
End Sub

The results should look like the following.

code(1) serial(1) amount(1) code(2) serial(2) amount(2)
1 11 100 1 11 100
1 12 200 1 12 200
1 13 100 1 13 100
2 14 100 2 14 100
2 15 100 2 15 100
3 16 100 3 16 100
4 4000 4000
5 5000 5000
6 6000 6000