+ Reply to Thread
Results 1 to 9 of 9

Is there a faster way than a loop to delete rows that satisfy a criteria

Hybrid View

mortphil Is there a faster way than a... 02-28-2014, 09:10 AM
JOHN H. DAVIS Re: Is there a faster way... 02-28-2014, 09:18 AM
jindon Re: Is there a faster way... 02-28-2014, 09:29 AM
mortphil Re: Is there a faster way... 02-28-2014, 09:43 AM
mortphil Re: Is there a faster way... 02-28-2014, 09:36 AM
jindon Re: Is there a faster way... 02-28-2014, 09:49 AM
mortphil Re: Is there a faster way... 02-28-2014, 09:52 AM
jindon Re: Is there a faster way... 02-28-2014, 09:59 AM
mortphil Re: Is there a faster way... 02-28-2014, 12:14 PM
  1. #1
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Is there a faster way than a loop to delete rows that satisfy a criteria

    7 for Sunday?
    1 for Sunday to me...
    Sub test()
        With Range("a1", Range("a" & Rows.Count).End(xlUp))
            .Value = Evaluate("if(weekday(" & .Address & ")=7,""""," & .Address & ")")
            .SpecialCells(4).Delete xlShiftUp
        End With
    End Sub

  2. #2
    Forum Contributor
    Join Date
    06-24-2013
    Location
    Berlin
    MS-Off Ver
    Excel 2007
    Posts
    188

    Re: Is there a faster way than a loop to delete rows that satisfy a criteria

    Jindon: your solution took 40 seconds. that is awesome.


    now, I need to understand it.

    1) I get the first part With "a range"
    2) the second line I don't entirely understand it. I have never used EVALUATE
    3) then you cleared any empty cell within the range using specialcells(4).delete

    thanks a lot for your solutions guys
    -Phil

+ 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] 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
  2. Delete the rows of a specific account if a certain column does not satisfy
    By exlgh91 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 04:10 PM
  3. Loop through rows and delete based on criteria
    By yolandaro30 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2012, 12:23 PM
  4. Loop to delete rows meeting criteria
    By narrowgate88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2009, 04:54 PM
  5. How to loop through worksheet and delete rows based on criteria
    By rgrogan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-20-2007, 05:28 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