LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Can anyone correct this code ???


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct code Corey Excel Programming 5 February 16th 07 03:35 PM
Please correct for me this code Freeman_100[_5_] Excel Programming 1 April 11th 06 08:37 PM
Please Help Correct my code saziz[_39_] Excel Programming 16 December 16th 05 01:24 AM
Code is not correct Pat Excel Programming 10 April 6th 05 02:03 AM
Help to correct code Pat Excel Programming 6 December 29th 04 05:02 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"