+ Reply to Thread
Results 1 to 5 of 5

Delete rows based on values in a column

  1. #1
    Forum Contributor
    Join Date
    02-09-2011
    Location
    Perth, Australia
    MS-Off Ver
    2016
    Posts
    161

    Delete rows based on values in a column

    Hi,

    I have three columns of data (Columns A, B and C). Row 1 of each is used for a heading.

    Column B contains either “AB” or “RL”.

    I want to delete any row that contains “RL” in column B.

    What VBA code can I use that will detect rows with “RL” in Column B and delete them?

    Please see attached example.

    Thanks very much

    Dave
    Attached Files Attached Files

  2. #2
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Delete rows based on values in a column

    Hi Dave,

    as a starting level, you can use below code to delete each row by checking one by one..

    Please Login or Register  to view this content.
    But if you are in hurry, you can use below code too..
    Please Login or Register  to view this content.
    Last edited by Debraj Roy; 08-28-2013 at 03:47 AM.
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  3. #3
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: Delete rows based on values in a column

    That looks sharp to me but I added a general note: when deleting columns (or rows) always start at then end and move up (to the left) using step -1 as here. It's faily obviouss after yov'e spent some time debugging the wrong soltion.

  4. #4
    Forum Contributor satputenandkumar0's Avatar
    Join Date
    11-08-2012
    Location
    Pune, India
    MS-Off Ver
    Office xp & Office 2007
    Posts
    398

    Re: Delete rows based on values in a column

    Dear Motox,

    user below code.

    Please Login or Register  to view this content.
    Regards,
    Nandkumar S.
    Regards,
    Nandkumar S.
    ---------------------------------------------------------------
    Don't forget to Click on * if you like my solution.

  5. #5
    Forum Contributor
    Join Date
    02-09-2011
    Location
    Perth, Australia
    MS-Off Ver
    2016
    Posts
    161

    Re: Delete rows based on values in a column

    Hi,

    Thanks all for your help.

+ 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. Replies: 8
    Last Post: 08-08-2013, 08:45 AM
  2. Delete Rows based on values present in another column
    By mlogan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2013, 03:13 AM
  3. Delete Rows based on values present in another column
    By booo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-26-2011, 05:19 PM
  4. Delete rows based on Column B Values
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2011, 01:49 PM
  5. Delete Rows based on Values in a column
    By Recycle_Bin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-21-2009, 04:36 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