Apply filter in existing excel column, we have to apply filter without #N/A and empty cells

Hi everyone, my logic is to put filter in column L from L3 cell actually L2 is our heading we have to put filter and select all things without #N/A and Blank values in existing excel.

Hi @Gopi_Krishna1

Sub FilterColumnA()
    Dim ws As Worksheet
    Dim rng As Range

    ' Define the worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1") ' Change "Sheet1" to your actual sheet name

    ' Define the range to apply the filter (assuming data starts from A2)
    Set rng = ws.Range("L2", ws.Cells(ws.Rows.Count, "L").End(xlUp))

    ' Apply the filter
    rng.AutoFilter Field:=1, Criteria1:="<>#N/A", Operator:=xlAnd, Criteria2:="<> "

End Sub

Hope it helps!!

@Gopi_Krishna1


Please give the Column index number of L.

In excel column index Starts with index 0

Hi. Read range workbook from A2 and add filter datatable activity with remove rows . Column 11 indicates column L of excel. Please try the screenshot steps.

It’s working fine in existing excel

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.