C
colwyn
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.
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.