+ Reply to Thread
Results 1 to 4 of 4

Script to delete rows when condition fulfilled

  1. #1
    Registered User
    Join Date
    02-05-2010
    Location
    Rotselaar, Belgrium
    MS-Off Ver
    Excel 2003
    Posts
    2

    Script to delete rows when condition fulfilled

    Hi,

    I have a sheet, in which I have to delete rows when the content of column X (f.e. "EUR" equals the content of column Y (f.e. "EUR"). The number of rows is not a fixed number, could be different each time I receive the sheet in my mailbox.

    I first add a column Z (=if(X=Y,"YES","OK"), and wanted to continue with IF Z="YES", then select the row, and delete it, but I do not know how to continue. If possible a solution whereby all meant rows are deleted at once, or if not possible, checking row by row.

    Rutger

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Script to delete rows when condition fulfilled

    You could autofilter column Z, select a value of "YES", and then delete all the visible rows.

  3. #3
    Registered User
    Join Date
    07-27-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: Script to delete rows when condition fulfilled

    Hi Rutger,

    The code below should do it (if I've understood).

    Please Login or Register  to view this content.

    Cheers,
    Dom

  4. #4
    Registered User
    Join Date
    02-05-2010
    Location
    Rotselaar, Belgrium
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Script to delete rows when condition fulfilled

    Thanks guys.

    Roger

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1