Thread: Easy loop
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Howard Howard is offline
external usenet poster
 
Posts: 40
Default Easy loop

I want to hide the entire row, if the value in column b is Yes.
So, I tried this:

Private Sub CAT()
For b = 1 To 25
If Cells(1, b) = "Yes" Then
Selection.EntireRow.Hidden = True
End If
Next b
End Sub

If cell B1 is Yes, it hides that row, but not any other rows with Yes in
column B. I don't know how to correct it.

Thanks,
--
Howard