Write to another sheet if excel rows is full

Hi Masters, I would like to write to another sheet once all entries are entered in excel rows,please how do I implement that?


Have you tried the activity call Read range and use it on the sheet you want to copy and then you could use write range to paste in the new sheet.


What do you mean by excel rows are full?

Can you share some sample Input output files?


Hi @RPA-botDev

Could you elaborate the requirement on brief?

Like Providing screenshot of input and required Output!


So this is the sample excel sheet, We have data greater than the normal exle rows so we would like to let it write the remaining data greater than 1048575 rows to sheet 2.
test1.zip (2.7 MB)

Sample file - test1.zip (2.7 MB)


Then you can check the Rows count as

IF Datatable.Rows.Count < 1048575

Take the actual count - 1048575

Then write a query as below

TmpDB = Datatable.AsEnumerable.Take(CountLeft).CopyToDatatable

Write Range for Sheet 1 as TmpDB

Now use another write range as Sheet2 and write another query as

TmpDB = Datatable.AsEnumerable.Skip(CountLeft).CopyToDatatable

this will skip the content already writen in the sheet1 and write the remaining to the Sheet 2

Hope this will help you


1 Like

What’s the variable type for TmpDB


It’s a Datatable

Check query is corrected

Hope this help you


1 Like

It worked Srini but it takes a bit of time, is there a way to make it write back to excel faster?


As you have lot of rows in the excel, so you can expect some delay in reading the entire rows

I believe you used the Read Range activity that’s why it’s delaying


1 Like


We can combine with these two activities
Did we try that

Cheers @RPA-botDev

1 Like