How to fill the gaps in excel with the previous value

how to fill the gaps in https://forum.uipath.com/t/comparing-two-columns-of-different-excel-sheets-in-an-excel-https://forum.uipath.com/t/getting-the-cell-values-from-one-sheet-corresponding-to-cell-values-in-another-sheet/85677and-replace-the-column-value/135155excel sheet with the previous value

Hi @gantada_Nikitha ,

I could not able to open the attached link. However as I understand your problem is need to fill the empty cells with previous values in a table. if yes below is the solution

write the below code in vb code activity

Dim dr As DataRow
Dim r As Integer
Dim i As Integer

r = 0
For Each dr In dt1.Rows
If (r > 0) Then
For i = 0 To dt1.Columns.Count-1
If (dr(i).ToString = “”) Then
dt1.Rows(r)(i) = dt1.Rows(r-1)(i)
End If
Next
End If
r=r+1
Next

where dt1 is the input table getting through arguments.

Thanks.