Hello i got stuck how to make this result working.
What i'm trying to do is to check a few columns information and then to give results.
1. I want to first check by column "U" workcenter is main character and column "C" and "F"
To read information regarding Connectors
Example: C88 is in workcenter 308V3O1
2. Now that it reads that this workcenter has this connector next step is to check the wires names from column "C" and "F" that contains "wire" and in columns "K" and "P" to check does it has this connector name if it has it then to check does it has in columns "M" and "R" are they empty cells. If they are empty to give result.
Here is my code that i try
VB.Net
Using workBook As XLWorkbook = New XLWorkbook(TxtPathLocation.Text + "\Production modules.xlsx")
Dim workSheet As IXLWorksheet = workBook.Worksheet(1)
Dim dt As DataTable = New DataTable()
Dim firstRow As Boolean = True
For Each row As IXLRow In workSheet.Rows()
If firstRow Then
For Each cell As IXLCell In row.Cells()
dt.Columns.Add(cell.Value.ToString())
Next
firstRow = False
Else
Dim cellA As IXLCell = Row.Cell(6) 'Note Connector
Dim cellB As IXLCell = Row.Cell(2) 'Production Module
Dim cellC As IXLCell = Row.Cell(21) 'Workcenter
Dim cellD As IXLCell = Row.Cell(3) 'Material
Dim cellE As IXLCell = Row.Cell(4) 'YazakiNumber
Dim cellI As IXLCell = Row.Cell(11) 'FromConnector
Dim cellJ As IXLCell = Row.Cell(16) 'ToConnector
Dim cellL As IXLCell = Row.Cell(5) 'SKNumber
Dim cellK As IXLCell = Row.Cell(9) 'CS
Dim cellY As IXLCell = Row.Cell(13) 'From CAE
Dim cellT As IXLCell = Row.Cell(18) 'TO CAE
Dim isLowerLetter As Boolean = False
If Not String.IsNullOrEmpty(cellC.Value) And Not String.IsNullOrEmpty(cellD.Value) And Not String.IsNullOrEmpty(cellK.Value) And cellA.Value.ToString().Contains("Connector") Then
If cellA.Value.ToString().Contains("wire") Or cellA.Value.ToString().Contains("Wire") Then
If cellI.Value.ToString().Contains(cellD.Value) And cellJ.Value.ToString().Contains(cellD.Value) Then
If String.IsNullOrEmpty(cellY.Value) Or String.IsNullOrEmpty(cellT.Value) Then
isLowerLetter = True
End If
End If
End If
End If
If isLowerLetter Then
DataGridView2.Rows.Add(cellC.Value.ToString(), "Production Modules", "", cellD.Value.ToString(), "Found issue with Wire CAE Cavity in Production Names")
End If
End If
Next
'dt.Columns.RemoveAt(0)
DataGridView2.Rows.Add(dt)
DataGridView2.Rows.RemoveAt(DataGridView2.Rows.Count - 1)
End Using