Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Meenachi Suppiah   on Feb 02 In MS Office Category.

  
Question Answered By: Juan Reynolds   on Feb 02

your approach is pretty good for someone who says they are
green...
How about trying this...
Sub erase_zero_rows()
Dim rCnt As Integer, iCnt As Integer
Dim iColumnToStart As Integer
Dim iColumnToEnd As Integer
Dim iRowToStart As Integer
Dim iRowsAll As Integer

iRowToStart = 4
iRowsAll = 69
iColumnToStart = 2
iColumnToEnd = 4
iCnt = iRowToStart - 1
rCnt = iRowsAll
With Range(Cells(1, iColumnToStart), Cells(1, iColumnToEnd))
Do While rCnt
If WorksheetFunction.Sum(.Offset(iCnt, 0)) = 0 Then
.Offset(iCnt, 0).EntireRow.Delete
Else
iCnt = iCnt + 1
End If
rCnt = rCnt - 1
Loop
End With

End Sub

Share: 

 

This Question has 6 more answer(s). View Complete Question Thread

 


Tagged: