Copy selected columns from one Excel file to another

Hey, how can I copy out only the columns that are relevant to me from an existing Excel file and then paste them into a new Excel file?

Sorry if the question has already been answered, but I just started using UiPath and couldn’t find an adequate solution. Thanks a lot.

1 Like

Hai @Paulissen … Initially use read range that u need to copy in Excel( range of copyable coloumn) or Use Selector for select particular coloumn( Find element) then use write range activity to write in another Excel file…

Hello @Paulissen

You can do a read range to get the data to a datatable. Next, use removed datatable column activity to remove the columns that you don’t need and do a write range to write the remaining columns to a new excel file…

Hai @Lahiru.Fernando … I think @Paulissen just wanna copy a coloumn to new excel only … There’s no need to remove a coloumn I think so… Is there another way that he seeking for…

1 Like

Hey @Nandhuba

Thanks for checking :slight_smile:
From what I understood from the question is that @Paulissen wants to copy a set of columns that he need from one excel and to add it to another sheet.

Since there are multiple columns involved, I though the read range to datatable, and removing the unwanted columns from the datatable is the best approach… and there is no UI interaction required…

Anyway, correct me if I understood in a different way :smiley:

2 Likes

@Paulissen
What @Lahiru.Fernando said is correct. Just one change in it, if there are too many columns in excel and you want very few columns to be copied, then using remove datatable column will be an expensive process. Instead, use Filter data table.

  1. Using read range activity, read data from excel.
  2. Use Filter data table activity. In the Filter Wizard,
  • Do not specify anything in Filter Rows tab.

  • In output columns tab, Mark column selection mode to “Keep” and Under columns, add the columns that you want in your output datatable.

  1. Use write range activity to write the data in new excel/sheet.
2 Likes

It worked perfectly, thank you very much for the fast and good help to you all. :slight_smile:

1 Like

Hey @Paulissen

Hey It is possible.

just look in an existing thread of 2017 :slight_smile:

This will help you :slight_smile:

Regards…!!
Aksh

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