Firstly check if the value of column C is empty for the current row. You can use an If activity - String.IsNullOrEmpty(row(“C”).ToString)
Then use assig acivity ,
If activity with the condition String.IsNullOrEmpty(row(“C”).ToString).
Assign activity to set the background color of the next row to orange.
Assign activity to set the background color of the current row to blue.
Happy Automation
Please mark this as a solution if it helps you.
I believe the example data provided by you is still not maybe representing the original data, as there are still questions that can be raised on the data.
You did mention that HERE is empty, but the line next to it is also having empty string, So what is the Difference between HERE being empty and the empty String below it ?
Are we supposed to Check for HERE or empty string. This is asked now so that it might not effect in later code developments.
Also, If you could provide the Data in the form of Excel sheet, it would helpful to investigate faster.
If I understand correctly…whenever you see an empty cell in C column then you want the data from next row to be populated to the current row
You can read the data into datatable…
Then use for each row in datatble and inside that use write cell activity if if condition
For each row in datatable…and in properties of for loop assign the index to a variable index
Use a if condition to check for empty IsNothing(currentorw("ColC")) OrElse String.IsNullOrEmpty(currentrow("ColC").ToString.Trim)
On the then side use write cell activity will value as dt.Rows(index+1)(“Requiredcolumnname”).ToString and cell value as "D" + (index+2).ToString …change D to any column you want to write into
Hi @DimitriLYR ,
No problem ,
Then in this case do this( go step by step).
For Each Row activity to loop through the DataTable.
If activity with the condition String.IsNullOrEmpty(row(“C”).ToString).
assign activity to store the values of the current row in a DataRow variable.
If activity with the condition previousRowOrange AndAlso Not IsNothing(orangeRow).
assign activity to replace the current row with the orange row.
assign activity to set the background color of the current row to blue.
assign activity to set the Boolean variable previousRowOrange to the result of the previous If activity.
End the For Each.