Do the sorting column A(Account Number) – BM(Custom Data 34) – (recon report that we renamed) based on Column AQ (“Custom Data 12”)
scrrenshot i have attached can you please share me a code for this
Hi @swethareddy
Use below steps:
- Read Range (A:BM) →
dt_ReconReport
- Sort Data Table
- Column:
"Custom Data 12" (AQ)
- Order: Ascending/Descending as required
- Write Range back to Excel.
This will sort the entire range A (Account Number) to BM (Custom Data 34) based on AQ (Custom Data 12).
Happy Automation
iampnkz
(Pankaj KUMAR)
3
Hi @swethareddy,
If you’re referring to sorting Excel rows by cell color in UiPath:
- Excel activities do not currently support Sort by Color directly.
- You have a few alternatives:
- Use VBA to sort by cell color.
- Use UI Automation to perform the Excel ribbon action
Thanks
Prashanth_D
(Prashanth_dharavath)
4
Hi @swethareddy,
I assume sorting should just be done based on “AQ” (or “Custom Data 12”) column and not based on the color.
Here’s the logic for sorting:
- Use “Excel Process Scope” (Modern Excel activities).
- Use “Read Range” to read the data (Columns A:BM) into a DataTable, e.g., “dtRecon”.
- Add a “Sort Data Table” activity on “dtRecon” DataTable.
- Column: “Custom Data 12” (or “AQ” if there are no headers)
- Order: Ascending or Descending as required.
- Use “Write Range” to write the sorted DataTable back to the same sheet.
Cheers!