Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() This code is designed to delete rows which dont have data in column I. However, after several hours running, it just freezes up the s/s and I have to close it down. Code: -------------------- Sub delRows() Dim rClear As Range Dim Rw As Long Dim LastRw As Long With ActiveSheet LastRw = .Cells(.Rows.Count, 1).End(xlUp).Row For Rw = LastRw To 3 Step -1 If Application.WorksheetFunction.CountA(.Range(.Cells (Rw, 1), .Cells(Rw, 10))) = 2 Then If rClear Is Nothing Then Set rClear = .Cells(Rw, 1) Else: Set rClear = Union(rClear, Cells(Rw, 1)) End If End If Next Rw rClear.EntireRow.Delete End With End Sub -------------------- Can anyone tell me what is wrong and/or correct the code to make it workable?? Big thanks. Colwyn. -- colwyn ------------------------------------------------------------------------ colwyn's Profile: http://www.thecodecage.com/forumz/member.php?userid=34 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=44836 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Correct code | Excel Programming | |||
Please correct for me this code | Excel Programming | |||
Please Help Correct my code | Excel Programming | |||
Code is not correct | Excel Programming | |||
Help to correct code | Excel Programming |