How to dynamically delete data of some columns

Book1.xlsx (10.3 KB)

I want to dyanmically delete data of the columns B and C in of the Above Excel

My Data that means my Numbers of Rows are not constant everytime sometimes there are 10 rows sometimes 5 and it varies How DO I achieve this

I tried using Delete Range but somehow it fails Because it that we have to Specify the Cell Number also which I can’t in my case because my Data i.e number of Rows is not constant

Any Help is appreciated :slight_smile:

in such cases we can read in the excel into a datatable and dynamicly calculate the ranges e.g. YourDataTableVar.Rows.Count

for deletion the cells in excel we do have several options. One approach is to create a 1 column Datatable with X rows and empty values then write it back to the excel (with the range e.g. B2 for a B column deletion) and delete the column values. Do not missout to handle the first row properly when the first row is containing the column header

Hi @Ishan_Shelke,

If you want to delete the column itself, you can use the activity Insert/Delete Column and specify the ChangeMode property to Remove.

Set the position and no. of columns. This will delete the columns from the excel.

image

You can use this project
delete_data_rows.xaml (10.8 KB)

I have made it dynamic so you can edit it as per your requirement

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