View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jessica Jessica is offline
external usenet poster
 
Posts: 113
Default Hide Rows if all values are zero

I tried this and received the error message "Compile error: Next without For"

"Jef Gorbach" wrote:

Dont have a copy of Excel handy to test, but sounds like you want
something along the lines of:

Sub untested()
Dim myrange As Range
For row = 2 to Range("A65536").End(Xlup).Row
myrange = Range(Cells(row,"A"),Cells(row,"d"))
If Application.WorksheetFunction.Sum(myrange) = 0 Then
myrange.EntireRow.Delete
Next
End Sub

.