Replacing a cell value "-" into another cell value "0"

Good Day,

I am trying to replace each row in Width column that has a value of - into 0. May I know the efficient solution where it can process thousand of rows quickly?

Kindly see picture below and the attached file for the sample file. Thank you.


SampleExcel.xlsx (9.1 KB)

Best regards,
Robert Russell Monsalud

1.Take Read Range Workbook Activity to read your excel data and create a variable = YourDataTable

2.Take Assign Activity

YourDataTable = YourDataTable.AsEnumerable().Select(Function(row)
row(“Width”) = If(row(“Width”).ToString() = “-”, 0, row(“Width”))
Return row



How about Find/Replace Value activity?


Sample (2.7 KB)


Hi @RobertRussell_Monsalud
=> Use Read Range Workbook to read the Excel and store the Output in a variable say dt_data.
=> Use the below syntax in Assign activity:

dt_data = dt_data.AsEnumerable().Select(Function(row) 
    If row("Width").ToString() = "-", 
        row("Width") = "0"
    End If
    Return row

=> Use Write Range Workbook to write the data again back to excel.

Hope it helps!!


Step 1: Use read range (preferable workbook activity) store the output in dt_sample .
Step 2: use Invoke code activity with in_argument as the datatable variable as shown below
Step 3:Add the following code in edit code:
End If
End Sub