Tell me how you can cycle compare 2 Excel files with Epplus. I can not. I can find a match, but it is necessary that when I find it, I check the condition in the string for another value.

foreach (var item in ws2.Cells["B:B"]) { foreach (var item2 in ws.Cells["T:T"]) { if (item.Value.ToString() == item2.Value.ToString()) { kol++; label8.Text = kol.ToString(); } } } 

If done through Microsoft.Office.Interop.Excel, it turns out like this:

 for (i = 1; i < objXlsx.Columns[20].Cells[objXlsx.Rows.Count].End(Excel.XlDirection.xlUp).Row; i++) { x_Count = objUserXlsx.Columns[2].Find(objXlsx.Columns[20].Cells[i], Type.Missing, Excel.XlFindLookIn.xlValues, Excel.XlLookAt.xlPart); if (x_Count != null) { result++; bunifuCustomDataGrid1.Rows[StrokaPochtamta].Cells[3].Value = result; if (objXlsx.Cells[i, 5].Value == "то что надо найти") { resultat2++; } if (objXlsx.Cells[i, 4].Value == "то что надо найти") { resultat3++; bunifuCustomDataGrid1.Rows[StrokaPochtamta].Cells[5].Value = resultat3; } if (objXlsx.Cells[i, 4].Value == "то что надо найти") { resultat4++; bunifuCustomDataGrid1.Rows[StrokaPochtamta].Cells[6].Value = resultat4; } } } 

And how to do this through Epplus.

  • specify the question, it is not entirely clear what you want to receive. - Monomax
  • As it turns out? Do not forget, I do not sit behind your back, and your thoughts do not read! - Monomax
  • Added changes to the main text. Maybe it will be so clearer. - Arthur Chal
  • Try first to describe with words what you have and what you want to receive, while it is not at all clear what is happening there. - Monomax
  • Look, I have two Excel files, then I cycle in the first file in Columns (20) and look for matches in the second file in Columns (2). If matched, then brought the number of matches. Next, it checks another condition in the found match. - Arthur Chal

0