DoWhile each cell value is the same

I have a project where I am reading an excel workbook into a data table and inputting data into a web application. There are two parts, first the business unit is repeated on each line which coincides with a child value. Each time it changes I need the first line of the business unit to populate the header in the web application. I have the part working where I add header information. I have the code set to read each row and if => businessUnit.Equals(row(4).ToString) which means I only look at this row once for the header detail regardless of how many times the same value is repeated.

Second part is where I run into questions, I need to read a specific range of cells by row from the same spreadsheet and if the business unit matches the child value, I need to copy each child row and then paste that row data into the details part of the web application.

How do I tell the bot that in part 2, if the business unit and child value match, paste each line until they don’t match.

I am wondering if anyone can help me with figuring out the next part of this. I do not see any examples of this scenario on the forum and I am quite new to bots.

I don’t completely follow, but the answer to this question

I basically want to know what if any is the code to do the opposite of what I am doing above.

Is the following: if => businessUnit.ToString.ToUpper <> row(4).ToString.ToUpper