Excel delete multiple columns

Hi,

How to delete multiple columns in the excel sheet
del.xlsx (9.4 KB)

i want to remove course & fee column from the attached excel sheet .
Please provide me sequence

hi @vikumars

Based on Macro we can delete multiple columns in the sheet
use the below code
Sub sbVBS_To_Delete_Multiple_Columns ()
Columns(ā€œA:Cā€).EntireColumn.Delete
End Sub

Mention the column name and use Excel Application and use execute macro activity and call the function name as sbVBS_To_Delete_Multiple_Columns

Thanks
Ashwin S

1 Like

@AshwinS2

Could you please provide me in sequence,it will be useful to understand

Hi @vikumars,

Delete column
Try Send hot key to delete the columns.
Alt+H,D, then C

Else try Macro to delete the columns.

Regards,
Arivu

hi @vikumars

Please find the attachment Sample_Macro_Execution.zip (2.1 KB)

Do i need delete column activity and then use this send hot key??

hi @vikumars

@arivu96 Is telling you to use Send Hot Key Activity

Thanks
Ashwin S

There should be a better way to do this.

The Remove Data Column activity should be able to accept a list of ints.

:stuck_out_tongue_winking_eye:

I found a better way to do wath I wanted, maybe this can be the answer to your question.

By using a Filter Data Table and then go to the Output Columns and click Remove and then specify the index of the columns you would like to remove (Name of the column also work).

@vikumars

1 Like