Deleting Null Rows

Hi, I want to delete the Null rows suppose.

Ex. A20:A30 this is the range so I want to delete the entire rows between A20 to A30 in excel.
If I filled the date from A20 to A25 so I want to delete the last 5 rows means A26 to A30.
@Palaniyappan @Lahiru.Fernando @HareeshMR @aksh1yadav

1 Like

yah of course we can use this activity DELETE RANGE activity

–first use a excel application scope and pass the file path as input
–insde the scope use a read range and get the output with a variable of type datatable named outdt
–use a for each row loop and pass the above variable as input
–inside the loop use a if condition like this
string.isnullorempty(row(0).tostring)
if true it will go to THEN part where we can use a assign activity like this
int_range = outdt.Rows.IndexOf(row)+1
where int_range is a int32 variable
–now use a delete range activity where we can mention the range like this
“A”+int_range.tostring+“:A”+outdt.Rows.Count.ToString

hope ths would help you

Cheers @balkishan

1 Like

Thanks for the reply bro.

But here is not range option na, If I can see it’s starting the range from the A2 and calculated all the data rows in an excel then delete it.

I want to give from like A20 to A30 because after A30 I have many rows of data same I have to delete that rows data from specific range.
Basically I want to delete the two times like, A20 to A30 in this range I want to delete the NULL rows.
Second A40 to A50 in this I want to delete all null rows.
Hope you understand bro.

Note. Always I want to delete from the specific range only.

1 Like

Even this not deleted any empty rows bro.

1 Like

Fine
let me check once
Cheers @balkishan

sure bro

@balkishan

I’m not sure whether this solves your issue, but just read the entire data in the data table and use LINQ to check the empty rows without iterating (I hope there is a way) and delete the entire empty rows

or

use filter data table to delete the empty rows