+ Reply to Thread
Results 1 to 7 of 7

Delete with rows with filter

  1. #1
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Delete with rows with filter

    Hi all ,

    I have code that deletes everything but not in the criter field .
    unfortunately I was able to do it for 2 criteria's cant we expand it to 3 and more ? . I don't want to delete one more criteria ie ("DZ")

    how do I add it to the code .


    below is the code for your reference

    Please Login or Register  to view this content.
    attached is the file with the example for your reference .
    Attached Files Attached Files

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Delete with rows with filter

    is it not giving you the autofilter option for "DZ" because there are no instances in column j

    and should your word "Dont" read as "do"??

  3. #3
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Delete with rows with filter

    Mate- I agree with you .. lets manipulate the date to our convenient and do it .. because this time it is not available .. next time when I pull the report it will be .. so can we do it ?.

    I tried manipulating the data but I am getting error..

  4. #4
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Delete with rows with filter

    Ok let me put this clearly ... the sheet I have attached in column J there are different codes (RW ,DB, DG ,DR ,RV ,DA, DZ) I want everything to be get deleted , but not (DA, DB, DZ) . I have code that is allowing me for two criteria's (DB,DA) I want to add the 3rd one as well(DZ). how do I do it ?.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete with rows with filter

    Here's an option using a loop

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    05-04-2016
    Location
    London
    MS-Off Ver
    MS Office Excel 2010/2013
    Posts
    354

    Re: Delete with rows with filter

    Hey John... hope you doing good yes this is what i was looking ... its fantastic ... as always you are the best mate ..

    i have one quick question for you , whats wrong with my Code , i was not able to add another criteria .. why ?.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete with rows with filter

    Most of my readings on this is that once you need more than 2 criteria you could either use an Array("Item1", "Item2", "Item") or to loop. I don't have an answer as too why. BTW I don't think "<>" works with the Array option. I could be wrong though.

+ 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. [SOLVED] Filter and Delete Rows
    By arpanpanchal in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2016, 11:20 PM
  2. Delete Rows hidden by either Auto Filter and Advanced Filter
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-05-2013, 10:29 AM
  3. [SOLVED] Filter/Delete Rows
    By ryannjohnsonn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-17-2012, 04:14 PM
  4. Delete rows after filter with VBA
    By cmb80 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2012, 08:54 PM
  5. Delete & Merge Columns,Delete Rows with filter, etc
    By traderindia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2009, 02:12 AM
  6. Delete Rows After a filter
    By koda86 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-25-2008, 05:02 AM
  7. Delete Rows After a filter
    By koda86 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-24-2008, 09:20 AM

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