Hi,
I have an scenario where the dates and serial numbers are in a single column.
I have to arrange the dates in a order where serial number should be replaced by the date in the upper cell.
I have tried an if condition logic but my file contains 30000 records. So it is taking too long to complete.
I have attached file for reference
Thanks in advance.
Test.xlsx (226.8 KB)
Yoichi
(Yoichi)
October 7, 2023, 1:47am
2
Hi,
How about using InvokeCode as the following?
Dim i As Int32
Dim m = dt.Rows.Count
Dim previous As Object
While(i<m)
If DateTime.TryParse(dt.Rows(i).Item(0).ToString,Nothing) Then
previous = dt.Rows(i).Item(0)
Else
dt.Rows(i).Item(0)=previous
End If
i=i+1
End While
Sample
Sample20231007-1aL.zip (176.1 KB)
Regards,
Anil_G
(Anil Gorthi)
October 7, 2023, 3:38am
3
@Rupesh_Parle
Try this in invoke code where dt is to be passed as in/out argument and dt1 the same datatable as only in argument
Dt.AsEnumerable.ToList.ForEach(Sub(r,i) r("sr no") = If(r("sr no").ToString.Contains("/"),r("sr no").ToString,dt1.Rows(i-1)("sr no").ToString))
Hope this helps
Cheers
system
(system)
Closed
October 12, 2023, 12:33am
4
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.