+ Reply to Thread
Results 1 to 6 of 6

Delete rows based on filtered criteria

  1. #1
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Delete rows based on filtered criteria

    Hello,

    I am writing a macro which I need to delete rows that will be displayed after filtering column AD for "Archive"

    I have left a macro in the sample file that I came up with but it is not correct.

    I do not know how to change it to make it work.

    Appreciate anyone's getting hands on this.

    Thank you in advance,

    Simon
    Attached Files Attached Files
    ...and this is when I walk in, dressed fully in white...

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Delete rows based on filtered criteria

    Suppose you have filtered data .. try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Delete rows based on filtered criteria

    Close
    Maybe this will work for you,
    Please Login or Register  to view this content.

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,964

    Re: Delete rows based on filtered criteria

    Using your code....
    Please Login or Register  to view this content.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Delete rows based on filtered criteria

    Hello,

    Thank you very much for your help. Sorry for the long wait for a reply. I was on holiday - lucky me and just got back to the project.

    Both version davesexcel and sintek are working fine in terms of removing the unwanted rows however they remove the filter from row 5. Is there a way to do what is intended and keep the filters on row 5?

    Appreciate your help.

  6. #6
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Birmingham, UK
    MS-Off Ver
    2007
    Posts
    185

    Re: Delete rows based on filtered criteria

    Never mind. I should have thought of it right away.

    Just added Autofilter to row 5 line in the code and we are back in the game.

    Thank you.

+ 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] Delete Rows Based on criteria
    By matrix2280 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-24-2015, 09:47 PM
  2. Delete Rows based on 3 or more criteria
    By rz6657 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2013, 03:14 PM
  3. Delete Rows based on Criteria
    By amandaca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-19-2011, 09:40 AM
  4. delete rows based on a criteria
    By Ralem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-12-2011, 06:47 AM
  5. delete rows based on 2 criteria
    By ashleykelley in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2007, 11:20 AM
  6. [SOLVED] Delete rows based on certain criteria
    By Coal Miner in forum Excel General
    Replies: 2
    Last Post: 03-03-2006, 02:00 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