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: 2
Default Delete rows w/o criteria

I'm making a basic statement error in my program lines
below. Please help.
The company is tracking sales data. Sale rep's send in a
xl sheet monthly. Their data is imported into a master xl
sheet for charting, statics and review. Any row in the
spread sheet that has valid data, row "S" will contain
a "1", Else "0" or "" if it is at then end of the master
sheet.
I need to clean this up so the that sheet contains only
valid data ("1")

What an I missing here

Sub CleanRows()
Dim r As Range
With Worksheets("Sheet1")
For Each r In Range("S2:S" & Cells(Rows.Count, "S").End
(xlUp).Row)
If r.Value = "" Then
Exit Sub
ElseIf r.Value = 0 Then
Rows.Delete
End If
Next
End With

End Sub
 
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
Delete rows based on multiple criteria puiuluipui Excel Discussion (Misc queries) 6 July 3rd 09 01:58 PM
Delete all rows if criteria not matched ongcong Excel Discussion (Misc queries) 4 August 25th 08 07:58 PM
Delete rows if specific criteria not met. SITCFanTN Excel Worksheet Functions 3 July 5th 06 12:20 AM
Delete rows based on criteria Chris_t_2k5 Excel Discussion (Misc queries) 2 April 11th 06 01:52 PM
Delete rows based on certain criteria Coal Miner Excel Discussion (Misc queries) 2 March 3rd 06 05:56 PM


All times are GMT +1. The time now is 05:14 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"