+ Reply to Thread
Results 1 to 10 of 10

VB Code to find certain text and delete row

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    VB Code to find certain text and delete row

    Hello:

    Please refer to attached file.
    I have data as shown.
    Need VB Code to find "B'Fast" in column A and delete the row.
    Let me know if you have any questions.
    Thanks.

    Riz
    Attached Files Attached Files

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,890

    Re: VB Code to find certain text and delete row

    Try:
    Please Login or Register  to view this content.
    This will also take care of multiple occurrences.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to find certain text and delete row

    Hello Mumps1:

    This works, however i want to avoid using Filter part.
    In my data there will be only one instance of "B'Fast*" in cloumn A if any.
    Would like to first search for "B'Fast*" and delete that row.
    Please let me know if you have any questions.
    Thanks.

    Riz

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,890

    Re: VB Code to find certain text and delete row

    Try:
    Please Login or Register  to view this content.
    Last edited by Mumps1; 09-11-2016 at 10:34 AM.

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VB Code to find certain text and delete row

    @ Mumps,

    A single End Sub would suffice.LOL

    You make me feel good, as it is not only me slipping up sometimes!

    Kind Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  6. #6
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VB Code to find certain text and delete row

    You can try this:
    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: VB Code to find certain text and delete row

    You can use this also:
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,890

    Re: VB Code to find certain text and delete row

    @Winon: Thanks for picking up on that. It's the old copy/paste problem.

  9. #9
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,434

    Re: VB Code to find certain text and delete row

    Hello:

    Thanks to all...Great
    Riz

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: VB Code to find certain text and delete row

    Hello Riz,

    Instead of hard coding "B'Fast", I would rather have the Code "Firing" from a value entered into a Cell on the Sheet, where the Code will respond to any value you enter in that Cell, and not only "B'Fast".

    For instance, tweaking Mumps1's Code;

    Please Login or Register  to view this content.
    See the attached sample file which I have played with.

    Of course I could have used any of the other great solutions as well.

    Thank you for the Rep, it is much appreciated!

    Kind Regards.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. find text in listbox on userform, delete row containing that text on spreadsheet
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-09-2016, 03:11 AM
  2. Replies: 4
    Last Post: 09-18-2012, 10:54 AM
  3. [SOLVED] Find and delete vba code
    By tlinton in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2012, 12:13 PM
  4. find text then delete two rows below it including row of found text
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2011, 08:05 AM
  5. Find and delete text from a cell with lots of text.
    By leonardzen in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-22-2011, 10:52 AM
  6. code:Find and Delete
    By billkelley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2009, 03:53 PM

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