Can we Create any Loop to execute below scenario? Copy sheets from multiple Excels and paste it in Master Excel

Hi

I am new to RPA and learner. i want to automate one basic scenario using RPA Automation

– Create one Workbook (Excel_1)

– Copy sheet from other multiple excel (Excel_2, Excel_3 and Excel_4)

– And add all sheets in Master Excel_1

I have created Automation flow but want to confirm that,

is this correct approach what I have created?.. i have used linear process (sequence)

Why am asking is that, for each action I provided DestinationPath, and i didn’t declared this globalpath at any global place and I didn’t apply any loops as well

1 Like

Hi,

For instance you have 4 files as File1, File2, File3 and File4 in Input folder and you have to create a master file and copy all files in one.

  1. Directory.getfiles(“File Path”)
  2. Use loop for each file
  3. Use read range workbook activity and read sheet into DT
  4. Create and write in master file sheet1 using write range.(Make sheets name dynamic with variable if you need in different sheets else just append)

step 2 to 4 will repeat untill all files are copied.

Hi Gula,
when we read and write, we are loosing Cell Colour, Format…ect (tried this and loosing Formats)
But when copy sheet we can have same format…but again it’s coming without loop
(everytime do i need to mention new sheet)

1 Like

you can create a sample template with the required format and colour you want… In automation just take a copy of that excel file retaining original template as it is and write the data in the copy of excel file.

Hi,
Welcome to UiPath Forum Community !

To Copy the sheet to another file that you can this activity “Copy ToFile”.

Video sample :