Delete Particular Column

Hi Guys

I have a excel(A,B,C,D,E,F,G,H,I,J) and i want to delete the particular column name(D,E,F)
IN EXCEL THROUGH WORKBOOK ACTIVITY.
Please help me with example

@Himanshu_Pratap_Rana
First do a read range of the excel from workbook
The in assign Your_dt=inputDt.DefaultView.toTable(false,“ColumnNameInCellA”,“ColumnNameInCellB”,allColumnsThatYouWant)

Cheers.

2 Likes

Hi @Himanshu_Pratap_Rana

Try this

Hope this might help you :slight_smile:

1 Like

if i am using excel application scope activity does not DELETE exactly column name
Example-A,B,C,D,E,F,G,H,I.J
Delete-D,E,F

i am using insert/delete
No of columns-3
Position-3

Hi @Himanshu_Pratap_Rana

Try this

Hope this might help you :slight_smile:

1 Like

Hi @Himanshu_Pratap_Rana

As you want to remove column D you should give the position as 4, to remove col E the position number should be 5

You need to use insert/delete column activity 3 times as you want to del 3 columns from an excel

Make sure the property of the insert/delete column activity is set to remove

output

Check the below workflow for ref

SampleProcess.zip (15.0 KB)

you can use delete column activity as mentioned above but in reverse order (starting from the rightmost column)

e.g. if you want to delete D,E,F
se deleteColumns activity, set position = 6 followed by 5, then 4

dont delete 4, then 5 then 6 because if you delete 4 first, the columns after 4 will shift left

Sequence.xaml (8.3 KB)

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