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 in word - Guide
- How to repeat rows in excel - Guide
- The following excel image has a vba program (see below). what will be the result after the program is executed? any cells not displayed are currently empty, and any cells with numbers are formatted numeric. sub afdo a=0 lastrow = cels(rows. count, 1). end(xdup). row for i =14 to lastrow step 2 a=a cellsii. 5) value next cells(lastrow 2, 1) value = "the sum - Guide
- Vba insert multiple rows - Guide
- Excel duplicate rows delete - Guide
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