+ Reply to Thread
Results 1 to 4 of 4

Delete whole row after filter

  1. #1
    Registered User
    Join Date
    04-06-2016
    Location
    California
    MS-Off Ver
    2007
    Posts
    1

    Delete whole row after filter

    Okay so here is my situation. Excel 2007, I have about 550k rows, with the first being a header. In column T I have a number that ranges from 0-999999, I would like to delete every row containing a 999999 number. I originally filtered and was just manually deleting them but there is just so many and it would take near 10 hours to delete manually... I am hoping there is a better way to do this with a VBA Macro. I am new to macros but do have some minor background with java programming. I also do have equations in this workbook that do need to remain. Thank you!

  2. #2
    Forum Contributor
    Join Date
    04-20-2015
    Location
    Switzerland
    MS-Off Ver
    2010
    Posts
    312

    Re: Delete whole row after filter

    try this code that should work just change yoursheet to whatever is your sheet name
    also note that the very last row in your worksheet will also be deletet so row number 1048576 will be deletet no matter what is in there cause i need an initial range for the union to work and i did not feel like finding the first occurance of 999999 first :D

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    06-02-2015
    Location
    delhi
    MS-Off Ver
    2010
    Posts
    104

    Re: Delete whole row after filter

    Hey Lopylobster ,

    Let me tell you a trick here, most of the people face this common problem, because deleting rows of Non Adjacent Range is troublesome, So Follow my steps and select which suits your need.

    1) Instead of deleting rows just apply filter on T column and not equal to 999999 , Copy all rows to another sheet, "Copy is much faster or efficient then deletion"
    2) Second trick Filter column T select 999999 and on right side in column U of these rows mark "A" , remove filter sort the data on U column in ascending. after sorting, use filter to select A and then delete it will get delete in seconds because it is adjacent.

    'Made by :- Mandeep baluja
    'https://www.facebook.com/groups/825221420889809/
    'https://www.linkedin.com/in/mandeep-baluja-b777bb88

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

    Re: Delete whole row after filter

    Maybe:

    Please Login or Register  to view this content.

+ 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. Filter and Delete
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-20-2014, 10:14 AM
  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. 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
  4. [SOLVED] filter and delete
    By Jordan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. filter and delete
    By Jordan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  6. filter and delete
    By Jordan in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  7. [SOLVED] filter and delete
    By Jordan in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-07-2005, 03:05 PM

Tags for this Thread

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