Automation SoftwareAutomation Anywhere
  Home > Product > Solutions > Excel Automation > T33  

T33 - Delete Duplicate Excel Rows

Task Description

Automation Anywhere provides easy Excel Automation. For more information see Excel Automation Solution. This examples shows how to sort the data in Excel sheet and delete duplicate entries if any.

Solutions
To see how the task runs in Automation Anywhere, download the files.

Test File T33.atmn    T23 Excel TestData.xls

Note: Save the xls in C: drive, the .atmn file in My Documents -> Automation Anywhere -> Automation Anywhere -> My Tasks

Below are the steps that make the Task:
1 Define Variables

Go to Variable Manager and create variables "C1", "C2", "N1" and "N2"


Excel Sheet
Screenshot 1







Task Editor
Screenshot 2









Excel Sheets
Screenshot 3


2 Create new task

Click on New->Task Editor.
3 Open Excel sheet

From Application Category->Excel, Select 'Open Spreadsheet' option.
4 Sort data in Excel sheet

Insert Keystroke command to sort data in Excel sheet.

Keystrokes: [CTRL DOWN]a[CTRL UP] in "Microsoft Excel - TestData.xls"
Keystrokes: [ALT DOWN]d[ALT UP] in "Microsoft Excel - TestData.xls"
Keystrokes: s in "Microsoft Excel - TestData.xls"
Keystrokes: [ENTER] in "Sort"
5 Go through all the cells until word 'STOP' found

Insert Loop for variable "Clipboard" not equal to "STOP".
6 Retrieve value of 1st cell

Insert Excel command to get the value of the first cell
7 Check for duplicate value

Insert a Loop to check value for currently active cell is equal to that stored in the variable "C1"

Loop While $N1$ Equal To $C1$
8 Check if condition is satisfied

i.e. Current active cell (C1) is equal to next active cell (N1) in line 1 and current active cell (C2) is equal to next active cell (N2) in line 2 and so on.

If $n1$ Equal To $c1$ Then
If $n2$ Equal To $c2$ Then
9 Delete the duplicate row

Insert Excel command to delete entire row

Excel: Delete Active Cell with option entire row.

If duplicate row is not found, go to the next cell in the row below.

Excel: Go to one cell below the active cell.

When you run this task, it will sort the data in an excel sheet. Then it will loop through each cell in first column until word 'STOP' is found and will delete duplicate entries from the first column.
Buy Now Free Trial

Next Steps
Compare versions Compare versions
Watch a flash demo Watch a flash demo
Contact me Contact me
Ask the Expert Ask the Expert
Request live demo Request live demo
Our Customers
Automation Anywhere Customers
Customer list | Case Studies

We started using this product to copy data from legacy system to new system. Now we use it just to do about anything automated. Countless hours saved. Thank you guys.
- Jack Greenberg

Read Customer Testimonies >>
  Products     Download     Purchase     Services     Support     Customers     Company     Sitemap     Trademark FacebookTwitterAutomation Anywhere BlogLinkedIn © Automation Anywhere, Inc. 2013 Privacy Policy
Automation Anywhere   

Automation Software - Free Trial Automation Software - View Demo