You can use For Each row activity like below,
Read excel and store in DT
For each row in DT{
if row(βEND_DTβ).ToString.Contains(β9999β) {
// write your date that you want to write by using write cell activity
// provide appropriate index to range of this activity i.e C2
(From i In Enumerable.Range(0,dtData.Rows.Count-1)
Let row = dtData.Rows(i)
Let chk = CDate(row("END_DT").toString.Trim()).Year = 9999
Let udt = CDate(dtData.Rows(i+1)("STRT_DT").toString.Trim()).AddDays(-1).ToString("dd-MMM-yyyy")
Let upd = If(chk,udt,"")
Let ra = row.ItemArray.Append(upd).ToArray
Select dtResult.Rows.add(ra)).CopyToDataTable
Output:
Depending on the data from input, maybe CDate will be replaced by another Conversion function in case of issues