Columns delete when it appears

Hello,

I have to automate an excel sheet and there’re few columns as below,
Grade
Department
Functions
Transaction

These columns needs to be delete when it appears. (It’s not appear always).
Kindly advise me on this.

Thank you.

@Udesheyy

You can use For Each for this

Use Read Range activity to read the excel file
After that place For Each activity and write as Datatable.Columns

Inside that place a IF condition and check the item.toString = on of the column Name then place Remove Data column activity

Hope this may help you

Thanks

1 Like

Hi @Udesheyy

Please refer this post,

In this the solution has been provided, just change the column names to the one you don’t want.

Change col1,col4,col34 to the column names you have to delete.

Thanks

Hi @Srini84

I tried this. And I’m getting error “Collection was modified; enumeration operation might not execute” like this.

Can you please help me to solve this.

Thank you.