Reading different sheets in same excel file

I want to create an RPA process using UiPath. I will explain every detail of this process, and I’d like you to guide me on how to do it in detail as well. Firstly, I have an Excel file named “Tractor” and two Excel files named “Archive.” The “Tractor” Excel file contains 26 sheets. Here is what I want to achieve: I want to copy the values from cells B2 to H25 of the sheets in “Tractor” where cell A11 is filled and paste them sequentially, one below the other, into a sheet named “Domestic” in the “Archive” Excel file. For sheets where cell A11 is empty, I want to copy the values from cells B2 to H9 and paste them one below the other into a sheet named “Import” in the “Archive” Excel file. How can ı do,?

@Ali_Osman_Kaya

This is how the steps would look like

  1. Use excel file and point it to tractor and excel reference as excel
  2. Use excel file and point it to archive and reference as excel1
  3. For each sheet in excel activity with reference as excel
  4. Inside loop use read cell activity and read A11 into a variable str
  5. Use if condition and check if IsNothing(str) OrElse str.Equals(String.Empty)
  6. On then side use read range activity with excel.sheet(currentsheet).Range("B2:H9") and read into datatable dt
  7. Next use append range with excel.Sheet("Import")
  8. On else side use another reqdin range with excel.sheet(currentsheet).Range("B2:H25") and read into datatable dt
  9. Next use append range with excel.Sheet("Domestic")

Cheers

Hi @Ali_Osman_Kaya ,
Sequence1.xaml (17.1 KB)

Please see the attached xaml.

Please mark it as solution if it helps you,

Regards,

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