LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


 
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



All times are GMT +1. The time now is 10:04 AM.

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"