How do I loop through a excel sheet and write cell if that rows contain the course name and date i want and skip/go to the next row if it does not fulfill my requirements.
Been trying for each loop and putting if else in the for each but its not working.
I suppose you know the column where you want to write in the cell.
So, letβs follow the below steps.
Have a int variable and assign it to 1 - this will be used within the loop to increment in each iteration to figure out the excel row we want to write in.
Use Read Range to read the excel to a datatable
use a for each row loop to loop through the data table.
within the loop, have a if condition to check whether it has the course name and date
Row("ColumnName").ToString.Contains(Course name variable)
Or
Use this if its empty when course name is not available String.IsNullOrEmpty(row("ColumnName").ToString)
Same goes with the date
now in the if condition, place the write cell activity to write the value in the desired cell.
Use the integer variable we declared to find the row. So in write cell, for the cell number configure it as follows
βDβ + rowNumberVariable.ToString
now outside the if condition, but inside the loop, place an assign activity and increment the row number variable by 1
Hi thanks for your help i have tried what u told me to do but its still not working it doesnt seem to be picking up the row. And the rowNumberVariable is not increment.