How to delete columns in Excel file

excel

#1

Dear Team,

How to delete columns in Excel file


Ui Path Excel Manuplation
Excel Name range activities
#2

Hello dear,

You should use following code for delete excel file column

Regards and Thanks,
Yogesh Shirsath


#3

Thanks Yogesh,but I want to delete specific columns eg. from G:AA, how to select these columns, after selection I can use the short cut key you have mentioned


#4

Hello,

There is no method for that in uipath but you can use .net method that is available in .net framewor and you can invoke any method from .net using invoke activty, you can learn about deleting rows here

Try this and comment your outcome please.

testtt(Autosaved).xaml (9.1 KB)


#5

Well, actually there are few workarounds.

  1. If you’re working with an Excel Table you can directly use Delete Column activity

  2. Though not so obvious, there are many things you can achieve via UI Automation and shortcut keyboards.

Let’s say you want to delete column C. This sequence of activities will work: Go To C1, ALT+H, D, C. Make sure you remove the Activate on the last two Type Activities. DeleteColumnC.xaml (8.0 KB)

Now, if you want to delete columns from G to AA you just need to repeat deleting column G 21 times.

This link will definitely help.


Add few features in Excel like Select Sheet, Clear Cells Values
#6

Lol, how about just “write value” , select the range you want and put “” on the value?? That will put it all blank. not deleted.

It works if you don’t want to bring the columns at right side to left one…


#7

Hello. Just to propose a different method you could use the Activity Select Range and specify all sorts of values:

  1. Individual cells (A1)
  2. A range (A1:B2)
  3. A column (A)
  4. A column range (A:I)

Then you just need to send a delete hotkey. Just remember to send the hotkey in the sheet itself.