MULTIPLE DATATABLE APPENDING IN AN EXCEL SHEET (such that there is no overlap or empty row in between)

Hi Team,
@aksh1yadav, @ovi, @Karthick_Settu, @KarthikByggari, @arivu96, @archanapandit, @Divyashreem, @ClaytonM, @PrankurJoshi,

I need a quick help from you.

I am currently working on the excel automation. For this I am doing the following:-

  1. Inside while loop I am doing data extraction (in other words I have the datatable)
  2. Now, I am writing this dataTable into the excel.
  3. In the second iteration, I get another data extraction(dataTable) which is appended to this one.

Now for this I want to know how do I get the cell number from where the appending on the second table will start such that there is no Empty row in between and also there is no overlapping.
I want to do this dynamically for multiple datatable appending in excel sheet.

Thanks and Regards,
@hacky.

append range activity itself will detect the first empty cell, you do not need to identify externally for this.
what is the purpose to know about the empty cell.? IF you want you can find this as Dt.rows.count
and keep adding this for every datatable will give you results.

1 Like

Hi @hacky

Does your Excel starts in first row (1) ? if your Excel start in the first row of the wb, you will be able to know the last cell, if you count the length of DT Column.

Cheers,
Pablo

2 Likes

As @Divyashreem said you can use append range activity.

Before appending the data to data table,

take count of rows, DT.Rows.Count

1 Like

@hacky,

follow this steps:

use Build Data table activity to create a new data table from variables.
If you want to append to an existing excel , First use Read Range activity to read into data table and then use Merge Data table activity to merge the two data tables.
At last use Write Range activity to write it in an excel.

1 Like

I knew about this logic, but I was wondering if theres some other logic to proceed with this.

@hacky you have to be carefull if your Excel doesnt start in the first row of the wb.

1 Like

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