I have excel 2 files.
I want to check input file with master file (sheet Correct).
I want check if 3 step
scenrio 1
if step1 true —> message box “step1” —> check next row in input file
scenrio 2
if step1 false ----- check step2 —> if step2 true message box “step2” —> check next row in input file
scenrio 3
if step1 false -----> check step2—> if step2 false ----> check step3 ----> f step2 true message box “step3” —> check next row in input file
scenrio 4
if step1 false -----> check step2—> if step2 false ----> check step3 ----> if step3 false -----> message box “not” —> check next row in input file
step as below.
Check column C from file input with column C file master If match check column J not empty cell and not value =“working”
Check column C from file input with column C file master If match check column E if match in column E file master ----> check column J = “working” or empty cell
Check column C from file input with column C file master If match check column J = “working” or empty cell
For Each row in inputDT
// Perform the lookup to see if Column C in inputDT exists in masterDT
matchedRows = masterDT.Select(“ColumnC = '” + row(“SR #”).ToString + “'”)
If matchedRows.Length > 0
masterRow = matchedRows(0) // Take the first matched row for comparison
// Scenario 1
If masterRow("ColumnJ").ToString <> "" AndAlso masterRow("ColumnJ").ToString.ToLower <> "working"
MessageBox.Show("step1")
Else
// Scenario 2
If row("ColumnE").ToString = masterRow("ColumnE").ToString AndAlso (masterRow("ColumnJ").ToString.ToLower = "working" OrElse String.IsNullOrEmpty(masterRow("ColumnJ").ToString))
MessageBox.Show("step2")
Else
// Scenario 3
If masterRow("ColumnJ").ToString.ToLower = "working" OrElse String.IsNullOrEmpty(masterRow("ColumnJ").ToString)
MessageBox.Show("step3")
Else
MessageBox.Show("not")
End If
End If
End If
Else
MessageBox.Show("not")
End If