Closed Thread
Results 1 to 2 of 2

Speed up cell deleting process

Hybrid View

  1. #1
    Registered User
    Join Date
    08-18-2008
    Location
    Singapore
    Posts
    79

    Speed up cell deleting process

    Hi there, is there anyway this process could be sped up?

    Sub DeleteDataPastDate()
    Dim i As Long, lastrow As Long
    lastrow = Range("A65536").End(xlUp).Row
    
    Sheets("Heldsec").Select
    
    For i = lastrow To 2 Step -1
    
        If Cells(i, 5) = "X" And Cells(i, 8) <> Date - 1 Then
        Cells(i, 1).EntireRow.Delete
        End If
        
        If Cells(i, 5) = "W" And Cells(i, 8) <> Date - 1 Then
        Cells(i, 1).EntireRow.Delete
        End If
        
        If Cells(i, 5) = "Q" And Cells(i, 8) <> Date - 1 Then
        Cells(i, 1).EntireRow.Delete
        End If
        
        If Cells(i, 5) = "" And Cells(i, 8) <> Date - 1 Then
        Cells(i, 1).EntireRow.Delete
        End If
        
    Next
    End Sub
    All help is appreciated.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Please read how to cross post in the link in my signature. There is a responce at http://www.mrexcel.com/forum/showthread.php?t=338196
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Deleting a space at the end of a cell..
    By Hodged in forum Excel General
    Replies: 3
    Last Post: 10-16-2007, 10:37 AM
  2. Deleting contents of cell results in formula
    By Colin@Tioga2 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-08-2007, 07:31 PM
  3. read cell content and use with Hyperlinks.Add Cell
    By apoc [t.i.m.] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2007, 10:02 AM
  4. Deleting Cell Values
    By aaser018 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2007, 12:07 PM
  5. Replies: 2
    Last Post: 11-23-2006, 09:54 AM

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