Excel - Reorder merged rows inside column

I have excel report file and I need to reorder the merged rows inside one column.
I have upload the example image for this.

Fist row don’t need to change.
Others rows need to upside down(as seen on image)

Can anyone guide me to fix this.

Thank you very much

I suppose the only way is to read cells you need to re-order into a datatable (using ReadRange activity), reorder and write back in appropriate order (using WriteRange or WriteCell activity).


1 Like

@J0ska Thank you very much for the reply. Do you have any idea about fixed the 1st record position and upside down the rest of the records. I’m try with datatable but still I’m unable to find a logic on this :slight_smile:


Can you share the excel sheet… As far I understand all you need is to get the records on a single line like CASH and soo on right???

1 Like


This is the excel file
2.xlsx (13.4 KB)

Yes I need it as single lines and that part is completed. But for the automation need to process last record first in the merged row :). And first record is need to remain same position for the calculations.

Could you also share the “to-be” state of the excel.

1 Like

I didn’t get it, what exactly you want :slight_smile:

You provided a sample excel “2.xlsx” - I guess this is what you currently have.
Could you also provide another sample showing the desired result?


1 Like

Hi @J0ska I have attached the excel with desired result. That column added after the column that need corrections and new desired output column highlighted in green color.

2_After_Correction.xlsx (13.6 KB)

Thanks :slight_smile:

And here you are…
ReorderMergedRows.zip (38.2 KB)

To use in your project you need to read this HOWTO: Use MS Office COM interop with UiPath


1 Like

Thank you very much @J0ska you saved my day.
It worked like a charm.
I’m really appreciate your effort.
:slight_smile: :slight_smile: :slight_smile:


1 Like

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