How to eliminate the values that ends with 11 in a column without linq query.
Using of linq query, in read range its taking more time to read the data so is there any alternatives.
Use the below VBA code and give a try:
Sub RemoveRowsEndingWith11()
Dim ws As Worksheet
Dim lastRow As Long
Dim i As Long
' Set the worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
' Find the last row with data in the specified column
lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
' Loop through the rows in reverse order
For i = lastRow To 1 Step -1
If Right(ws.Cells(i, "A").Value, 2) = "11" Then
ws.Rows(i).Delete
End If
Next i
End Sub
FLOW:
XAML:
Sequence45.xaml (8.7 KB)
Regards
cant we use in filter activity
Hi, Use this filter table linq query. replace Dt & coloumn name with your actual names.
DT.AsEnumerable().Where(Function(w) not w(“Colomnname”).ToString.Trim.EndsWith(“11”)).CopyToDataTable
yes here it is:
DT.AsEnumerable().Where(Function(w) not w(“Colomnname”).ToString.Trim.EndsWith(“11”)).CopyToDataTable
I have tried this but its not filtering
If you have very huge file then VBA would be best suited here. If you say you don’t want to use LINQ but want to use Filter activity, then you are defeating your own requirement.
LINQ & Filter activity both will require DataTable and that will be prepared only after reading the data.
Thanks,
Ashok ![]()
Book1.xlsx (44.3 KB)
filter modern activity dont need read range
Ok you meant Excel Filter. I considered DT Filter ![]()
yes modern activity filter
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

