Ignoring rows with zero value
Solved/Closed
ChrisCoR
-
May 11, 2011 at 08:14 AM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - May 16, 2011 at 11:54 PM
RWomanizer Posts 365 Registration date Monday February 7, 2011 Status Contributor Last seen September 30, 2013 - May 16, 2011 at 11:54 PM
Related:
- Ignoring rows with zero value
- How to delete rows and columns in word - Guide
- Excel insert multiple rows - Guide
- Repeat rows in excel - Guide
- How to know if someone is ignoring you on skype - Guide
- Filtering with spaces between rows - Excel Forum
3 responses
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
May 12, 2011 at 06:44 AM
May 12, 2011 at 06:44 AM
use following line in the end of your code.
Dim lastRow As Long Dim i As Integer lastRow = Range("K" & Rows.Count).End(xlUp).Row For i = 2 To lastRow If Range("K" & i) = "" Then Exit For If Range("K" & i).Value = 0 Then Range("K" & i).EntireRow.delete i = i - 1 End If Next i
You're a lifesaver! It works flawlessly. That eliminates about 4000 lines that I was sorting through originally. :)
RWomanizer
Posts
365
Registration date
Monday February 7, 2011
Status
Contributor
Last seen
September 30, 2013
120
May 16, 2011 at 11:54 PM
May 16, 2011 at 11:54 PM
You Are Most Welcome