Thread: Loop learning
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Vergel Adriano Vergel Adriano is offline
external usenet poster
 
Posts: 857
Default Loop learning

Something like this:

Private Sub CAT()
Dim i As Long

For i = 1 To Activesheet.UsedRange.SpecialCells(xlCellTypeLastC ell).Row
If Cells(i, 2).Value = "Yes" Then
Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub


"Howard" wrote:

Hiding entire row, if value in cell in column B is Yes.

Private Sub CAT()
Dim i As Long

For i = 1 To 25
If Cells(i, 2).Value = "Yes" Then
Rows(i).EntireRow.Hidden = True
End If
Next i
End Sub

Instead of using i = 1 to 25, can't I use the Count property? How would I do
that?


--
Howard