How to compare 2 row in 2 file excel, if data not equal then add result excel and add column status “Not Ok” or “OK”
Use Case Description
I have reached the stage of Joint 2 Excel files, it’s just still confused when giving conditions to add columns if columns A and B do not have the same value
Hi @bayu.herlambang - read Excel data into the datatable and do your operations on that update datatable and write back that on datable on your excel file.
hey @bayu.herlambang
try to use for each for dt from first file:
if → row("ColumnA").ToString() = dt2.Rows(dt1.Rows.IndexOf(row))("ColumnA").ToString() AndAlso row("ColumnB").ToString() = dt2.Rows(dt1.Rows.IndexOf(row))("ColumnB").ToString()
“Then” - assign “OK” to the “Status” column of the current row.
“Else” - assign “Not OK”.