+ Reply to Thread
Results 1 to 5 of 5

Delete row contents if keyword is found in Column E

Hybrid View

  1. #1
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Delete row contents if keyword is found in Column E

    Hi,

    I'm looking for some code that will delete the row it is in if the word 'Homework' is found anywhere in column E.

    Thank you

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Delete row contents if keyword is found in Column E

    Try

    Sub DelRows2()
        Application.ScreenUpdating = False
        With Sheets("Sheet1").Range("E1", Range("E" & Rows.Count).End(xlUp))
            .AutoFilter Field:=1, Criteria1:="Homework"
            .Offset(1).EntireRow.Delete
            .AutoFilter
        End With
        Application.ScreenUpdating = True
    End Sub
    Change sheet name to match
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    10-24-2012
    Location
    Budapest
    MS-Off Ver
    Excel 2003
    Posts
    19

    Re: Delete row contents if keyword is found in Column E

    Hi!

    For search us '.Find' , and for deleting the row '.EntireRow.Delete' .

  4. #4
    Registered User
    Join Date
    11-11-2012
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Delete row contents if keyword is found in Column E

    Thanks for the solution

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Delete row contents if keyword is found in Column E

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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