Delete row in excel when cell getting blank

Hello all, here I want to delete row in excel …if one particular cell is blank in that row… please help

Hi @dhanashree22

Your Steps would be as follows below!

Read Range the excel

For each row in read Dt

If Condition Currentrow(“ColumnNAME”) is nothing / Not String.IsNullOrEmpty(currentrow(“Columnname”).toString)

Then Use Remove Data Row Mention CurrentRow

And Write Range the Data table with the Same Path


1 Like

Hi @dhanashree22

You make use of below code,

RemoveBlankRowsinExcel.xaml (5.5 KB)

Hope this will help you. Thank you.

1 Like


Here is the inline code,

ExcelData.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()

Thank you.

Thank you , I will try this