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 Repetition of Code

Try something like this...

Sub HideRows()
Dim intCounter As Integer

With Sheets("Sheet2")
For intCounter = 1 To 135
If .Cells(intCounter, "G").Value = False Then _
.Rows(intCounter).Hidden = True
Next intCounter
End With
End Sub
--
HTH...

Jim Thomlinson


"Steve" wrote:

I need to repeat the following code for rows 1 to 135. If the value of the
cell in Column G is false, I need to hide the whole row. Rather than type in
masses of code, can anyone suggect some sort of loop to repeat 135 times.

If Worksheets("Quote").Range("G1") = False Then
Worksheets("Quote").Rows("1").Hidden = True
End If

Many thanks