View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ken Ken is offline
external usenet poster
 
Posts: 207
Default If or Case help - Which to use

Stephen

Either should work; but, since you really only have two options (hide
or not hide), I would go with a simple if statement.

Something like:

Unhide all the rows,t hen run this.

Sub test()

For i = 31 To 1000
If Application.And(Cells(i, 21) = 0, Cells(i, 22) = 0) Then
Rows(i).Hidden = True
End If
Next i

End Sub

should work for you.

Good luck.

Ken
Norfolk, Va






On Dec 10, 12:32 pm, Stephen
wrote:
I'm trying to say from rows 31 thru 1000, if U and V are zero then hide the
row. if not both zero then show the row.

Having problems putting this into an if statment wondering if I'd be better
served using a case statement but not sure how to write it.