Compare currentRow & nextRow same data Column

I have xml file to combine same row, it will compare column(P,AL) row1 with column(P,AL)row2, row2 with row3… It combine row3&4 correct but row7,8 don’t understand. Please help me

(RowPhu.Item(2).ToString=DataTableDLV030_Phu.Rows(idx+1).Item(2).ToString) And (Left(RowPhu.Item(1).ToString,6)=Left(DataTableDLV030_Phu.Rows(idx+1).Item(1).ToString,6))

nhap.xaml (829.5 KB)
DLV030.xls (76 KB)

1 Like

I want ask more how to compare all row excel to find same data row. Condition P(6char)& AL same)
Ex: row1 compare all row (row2-last row) → not same action1
row2 compare all row (row3-last row) → have same data row4,5 → action2
skip loop row3,4
row5 compare all row (row6-last row) → have same data row6,7 → action2

Thank