+ Reply to Thread
Results 1 to 4 of 4

Filtering and deleting unwanted rows

  1. #1
    Registered User
    Join Date
    11-28-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    73

    Filtering and deleting unwanted rows

    Disclaimer: I will say straight away that I am a VBA/macro noob. Most of my work up until now has been either simple recording or "cut and paste" from other established macros. Now on to my query.....

    I have a single paged spreadsheet (approx 500 entries) and I need to filter it by values in column B.
    To be specific column B has catalog #'s. I need only the rows with catalog #'s that match 15, 16, 17, and 106. All other rows need to be deleted. There will be several (approx 30) that match this criteria.

    It should be easy enough for someone who knows what they're doing but that's not me!

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Filtering and deleting unwanted rows

    How about:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Registered User
    Join Date
    11-28-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2010
    Posts
    73

    Re: Filtering and deleting unwanted rows

    Works like a charm. Thank you!

    I will have more questions and comments as I try and update existing macros used in my department. We analyze data and run reports all day and macros make it so much easier to parse out what's needed.
    Wish I knew more VBA.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Filtering and deleting unwanted rows

    Hi,

    The fastest and most efficient way I know of doing this is with a filter

    Create a criteria range on another sheet, say sheet2 and name it say "crit" (B1:C3) in this example.

    Row\Col
    B
    C
    1
    Cat# Cat#
    2
    <15 <>106
    3
    >17 <>106


    Then run the following macro

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ 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. Deleting Unwanted Rows
    By Covenite in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2012, 12:25 PM
  2. Deleting unwanted rows <10
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-25-2009, 11:21 AM
  3. Deleting unwanted rows
    By kevinho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2007, 05:25 PM
  4. [SOLVED] Deleting unwanted and empty rows....
    By Jim in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-05-2005, 01:05 AM
  5. Deleting unwanted and empty rows...
    By Jim in forum Excel General
    Replies: 2
    Last Post: 07-04-2005, 07:05 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