Delete an specific number of filtered rows

  • Hello again!


    i want to delete an specific number of rows after i filtered using autofilter im using the following code



    The main issue is that after sorting the data on the other worksheet the code erase all the filtered rows visible, but i want to know if exist a way to delete just a number of rows after filter, for example if i want to erase only 5 rows and after filter i have 10 rows it should delete only five, not all.

    Can someone help me?

  • Hello,


    It seems to me you could simplify your approach :


    By setting up your criteria in a way that enables the AutoFilter to only display the specific 5 rows you do need to delete ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Hello again Carim hope youre fine


    First of all sorry for answer so late, i was trying to apply to my code the solution that you gave but i still do not know how to display only a number of rows after filtered, how can i display only a number of rows with the autofilter option? i dont know how to set the criteria for that

  • Hello,


    Is there a chance you could attach your file ... with an explanation about your expected result ... ;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)