How to delete rows in Excel?

Hi Team,

How can I delete rows from Excel ?

Requirement- My header is starting from Row 3 , I need to filter out one column with value N/A and remove the filtered data from excel.

Please help me providing VBA code or anything that could work here.

you can use
filter data tabel Activity
you follow this workflow

where 0 is the index
it can be 0,1,2,3…
it depends on column


@Rounak_Kumar1 Thanks for the response. I need to delete the rows in Excel only

in filter data table, I have given the datatable as output OutDT
you can use Write range activity with datatable of OutDT

You can follow this example to delete/add any rows from excel.

If you want to filter and delete I suggest you filter the data set first (Sheet A) and copy what you need to another excel file (Sheet B) then delete all data from the main sheet (Sheet A) then copy from Sheet B to A.

Another easiest way is to use the Datatable function, which would save your time and processing time a lot.

Hello @Rahul_J

Please provide sample input excel. Also, let us know which column you want to filter with N/A value.

Use read range activity to read the excel.give starting insdex as A3

Use filter datatable activity and give condition either using column name or excel. Assume the filtered datatable name as filtered dt.

You can delete the existing excel if you dont want to maintain it and use write range activity to write the filtereddt with the same excel name or if you want to keep the excel ,write it to a different sheet in the same excel or you can write it into a different excel file based on your requirement