+ Reply to Thread
Results 1 to 10 of 10

Faster way to delete rows?

  1. #1
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Faster way to delete rows?

    Hi

    currently I have a spreadsheet with 30,000+ rows. I use the following code to delete rows that contain the value "A" in the Code column and also the value "sc" in another column. However, it takes 10min+ to run. I am wondering if there is a way to speed this up?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Faster way to delete rows?

    you can use autoFilter

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Faster way to delete rows?

    Maybe this could help.
    Please Login or Register  to view this content.
    It sorts the data ascending on column E, filters for "A" then deletes them. Repeat for column G. You may want to add a final sort to make your data back in original sorting, maybe on column A, I am not sure.
    多么想要告诉你 我好喜欢你

  4. #4
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Faster way to delete rows?

    works perfectly, thanks to you both

    I also have a column with venues that I use to do a vlookup to a list of venues, then if the venue is found, it deletes the row. This also takes a huge amount of time. Is there a way to speed this up also?

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Faster way to delete rows?

    the the vlookup seperately once then filter and delete

    here is the vlookup part
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Faster way to delete rows?

    thank you but I am having trouble deleting the rows. The vlookup returns 1 or the name of the venue. I tried using <> 1 but it doesn't work. I am having trouble with the line in bold. Do you know how I can fix this?

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Faster way to delete rows?

    I did not autofilter, I have it now. Thanks

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Faster way to delete rows?

    you left out the autofilter part

    Please Login or Register  to view this content.

  9. #9
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Faster way to delete rows?

    This might be a tad faster:
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    10-12-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016 in 2024
    Posts
    857

    Re: Faster way to delete rows?

    that is so much faster! Thank you to you both!

+ 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 and shift cells left - need a faster code
    By dry in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-10-2015, 09:44 AM
  2. Is there a faster way than a loop to delete rows that satisfy a criteria
    By mortphil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-28-2014, 12:14 PM
  3. [SOLVED] More efficient and faster way to delete Rows?
    By nironto in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-07-2013, 05:01 AM
  4. Any faster way to delete hidden rows of data
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2012, 02:58 PM
  5. Replies: 2
    Last Post: 01-16-2010, 09:27 AM
  6. how to delete faster in macro
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2009, 11:26 AM
  7. Faster way to delete?
    By jenrenea1 in forum Excel General
    Replies: 1
    Last Post: 05-06-2005, 05:17 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