+ Reply to Thread
Results 1 to 7 of 7

Macro to look for a specific word and delete rows

  1. #1
    Registered User
    Join Date
    01-23-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    58

    Macro to look for a specific word and delete rows

    Hi,
    I need to build a macro which will look for a specific word say :"ABC" in a particular column say "B" and delete 5 rows including the row containing the word "ABC"

    Does anyone have any idea how this can be done?

    Thanks.
    Last edited by excelaspire0219; 01-27-2009 at 06:41 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Macro to look for a specific word and delete rows

    Hello excelaspire0219,
    Here is macro to delete the 5 rows if the search word is found in column "B".
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro to look for a specific word and delete rows

    Or

    Please Login or Register  to view this content.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    01-23-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Macro to look for a specific word and delete rows

    Hello and thanks VBA Noob!! When I try to run the macro it does not do anything - I'm not sure if I need to change anything in the macro before I use it my spreadsheet?

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro to look for a specific word and delete rows

    Try Leith code and if that doesn't work post a sample file

    VBA Noob

  6. #6
    Registered User
    Join Date
    01-23-2009
    Location
    Chicago
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Macro to look for a specific word and delete rows

    Ohh I am sorry I thought both the codes were posted by you I apologize for that Leith. Thanks VB Noob and Leith - it worked!!

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Macro to look for a specific word and delete rows

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

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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