Thread: Another For Ron
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
scott scott is offline
external usenet poster
 
Posts: 577
Default Another For Ron

Here's a quick fix. It could be made faster, but it's an idea to start from.
It also depends on whether you plan to have blanks in your range. if you
have a very long list of data, it would also be advised to group ranges
before deleting them. anyways good luck with this.

Sub test()
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False

Dim i As Long
i = 1
While Cells(i, 1) < ""
cont:
If Not IsNumeric(Cells(i, 1)) Or Cells(i, 1).Value <= 0 Then
Rows(i).Delete
GoTo cont
Else: i = i + 1
End If
Wend
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True

End Sub

cheers,
Scott
"bm4466" wrote:


Hey Ron, you have always given me the right answer, so I'll ask you
this, as nobody has responded to my last few posts.
I need to make a script that goes through a sheet and deletes every row
where column J of that row contains a value that is not a number, or if
it is a number and less than or equal to 0...Any help is appreciated.


--
bm4466
------------------------------------------------------------------------
bm4466's Profile: http://www.excelforum.com/member.php...o&userid=33949
View this thread: http://www.excelforum.com/showthread...hreadid=568355