I have to remove the rows which has #N/A on column “AM” -. which is vlookup values. When I read the data and use filter data row activity and then writing down the data it gives below output and some different values of #N/A. Can someone suggest solution for this ? I tried using Formula “Read_LineItems.AsEnumerable().Where(Function(row)Not (row(“AM”).ToString.Trim.Contains(”#N/A"))).CopyToDataTable
Sub RemoveNA()
Dim lRow As Long, Rng As Range
lRow = With Sheets(1)
.Range("A" & .Rows.Count).End(xlUp).Row
End With
ThisWorkbook.Sheets(1).Activate
Range("B1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$D$" & lRow).AutoFilter Field:=2, Criteria1:="#N/A"
Set Rng = Range("A1:D" & lRow).SpecialCells(xlCellTypeVisible)
If Rng.Cells.Count > 1 Then
Range("A1:D" & lRow).Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
Else
End If
Selection.AutoFilter
End Sub
#N/A is not a value. It’s an error message in Excel. The best thing to do would be to correct the formula in Excel so you get a proper value instead of an error.
Write Cell: The write operation failed, because one of the following reasons:
► The data you want to write “=IFERROR(VLOOKUP(AL4,AN:AO,2,FALSE),‘NotFound’)” has a wrong format;
► Excel is busy or you are currently editing a cell;
► If your data is a formula, make sure you use comma as parameters separator;
► During the write operation make sure
You don’t use single quotes in Excel, you use double quotes.
What are you trying to do? Why are you writing that vlookup to Excel using UiPath? Why don’t you just do the lookups in your automation and then write the data?