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

Something like this...

Dim rng As Range
Dim rngToSearch As Range

With Application
..Calculation = xlCalculationManual
..ScreenUpdating = False
End With
Set rngToSearch = Range("U31:U1000")
rngToSearch.EntireRow.Hidden = False

For Each rng In rngToSearch
If rng.Value = 0 And rng.Offset(0, 1).Value = 0 Then _
rng.EntireRow.Hidden = True
Next rng

With Application
..Calculation = xlCalculationAutomatic
..ScreenUpdating = True
End With

--
HTH...

Jim Thomlinson


"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.