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

T32 - Delete rows from Excel spreadsheet based on specific criteria

Task Description

Automation Anywhere provides easy Excel Automation. For more information see Excel Automation Solution. This examples shows how to delete rows from an Excel sheet if the cell contains a specific word.

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

Test File T32.atmn    Test File Delete-Rows.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 Create a new task

Click on New -> Task Editor
Excel Sheets
Screenshot 1

Variable Manager
Screenshot 2

Task Editor
Screenshot 3

Excel Commands
Screenshot 4
2 Open Excel file

From Application Category->Excel, Select 'Open Spreadsheet' option
3 Create Variable

Click on Tools -> Variable Manager. Create variable Cell1 of type "value".
4 Loop through all the rows until the word 'STOP' is found

Insert Loop for variable "Cell1" not equal to "STOP".
5 IF Command

Insert If command to compare value of variable to specified criteria (For this task specified criteria is 'automation')
6 Delete the row if the criteria matches

If Criteria matches delete the entire row

Excel: Delete Active Cell with option entire row
7 Close Spreadsheet
  • Insert the Close spreadsheet command.
  • Uncheck the 'Do not save the changes' checkbox to save changes.

When you run this task, it loops through all the cells in the first column in excel sheet until word 'STOP' is found. If it matches criteria given by user then it will delete that particular row from excel sheet.

Note: You can run this task on any column. Simply keep the cell in that column selected before you run the task.
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

Call 1-888-484-3535

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 Blog © Automation Anywhere, Inc. 2012 Privacy Policy
Automation Anywhere Call: 1-888-484-3535 x1   

Automation Software - Free Trial Automation Software - View Demo