Delete range

Hey,

I need to delete all excel lines.

Can you help me ?

@Renan_Pereira

  1. First use Read Range activity to read excel file and will give you output as DataTable.

  2. int Count = yourDT.Rows.Count

  3. Then use Insert/Delete Rows activity and pass that count value into NoRows field and position as 0.

You can use delete range activity to do that @Renan_Pereira

Yes, how do I use delete range?

You can provide the range which you want to delete in the excel sheet.

Specify the range you want to delete and the sheet name.

If you don’t know the range or the number of rows, use read range and store the data in datatable. then you will get the number of rows using datatable.rows.count and store in a variable (assume count) and then specify the range as “A2:Z” + count.tostring which will delete entire rows except the headers

1 Like

Hi Iakshman, unfortunatelly this does not work in my project.

I want to delete all Values (and empty cells) in the column “A”

Thanks in advance!

@aaydin

Welcome back to our UiPath community.

Use Filter DataTable activity or below select query to filter all empty rows based on column A.

                          dtNotNullRows = inputDT.Select("[Column Name] is Not Null").CopyToDataTable

And then write this dtNotNullRows DataTable into new sheet and then delete previous existing sheet.

@lakshman

I have created as per below (screenshots)

I want just delete all values in a specific column.

But something in “Insert/Delete Rows” activity does not work.

Is it really so difficult?

Thanks in advance!

strong text

Screenshot2 Screenshot3 Screenshot4

Could you not just delete the column and then add it again?

It does not work, I have already changed the ChangeMod in Insert/Delete Rows acitivity in Remove. But nevertheless, there are no changes in the list :slight_smile:

@lakshman any idea? :slight_smile: