I want to delete columns in Excel starting from F

Hi everyone,

I have a scenario in Excel, i want to delete columns in Excel starting from F column and i don’t know how many columns will be . I want to delete columns starting from F to till end.

Can anyone help me how can I do this.

I want solution except Macro and VBA code.

@Learner007

you can use Read range activity by mentioning the range

image

cheers

Hey @Learner007 ,

Yourdatatablename = Yourdatatablename.DefaultView.ToTable(False,"columnnameA", "columnnameB", "columnnameC","columnnameD","columnnameE").copytodatatable()

Replace those with Your column name till e
And it will not write other than mentioned columns

Hope it helps you out!

Hi @Shiva_Nikhil if I want to use delete range means i need end column but I don’t know how many columns i will be getting in that excel

Hi @Vikas_M I’m getting error like copytodatatable is not a member of datatable

Actually I can’t specify the column names because in between few columns are empty how to handle that

@Learner007

try to make use of readrange activity and make the range upto which you want

hey @Learner007 , My bad
copytoDatatable was not required


This above works

Also if you don’t want to specify column names, then while reading from excel specify the range
Refer below image
image

Thanks @Vikas_M it worked. Read range only.

1 Like

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