+ Reply to Thread
Results 1 to 4 of 4

vba macro to remove rows if different from specific cell

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    vba macro to remove rows if different from specific cell

    Macro to remove all rows if different from B2...

    I have tried a number of ways but nothing is working, here are two of the macros Ive messed around with.

    It's supposed to look in B2 and then any of the rows below (B3, B4, B5, B6....etc) are different then it is supposed to delete entire row

    Please Login or Register  to view this content.
    Last edited by Hyflex; 10-10-2011 at 06:18 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: vba macro to remove rows if different from specific cell

    Hyflex,

    Something like this?
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: vba macro to remove rows if different from specific cell

    Your macro, deletes all rows apart from B2... I need it to keep some

    Basically B2 down to B9 consists of:
    Please Login or Register  to view this content.
    Any Cell in B what do NOT = B2 (06/10/2011) should be delete (in this case the last 3 rows)

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: vba macro to remove rows if different from specific cell

    Hyflex,

    Same macro, ran test with provided criteria, kept all 6/10/2011 rows, attached is sample workbook...
    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)

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