laddin
03-25-2003, 09:50 AM
I am trying to a looping function to hide and unhide rows on several worksheets in a workbook. Can anyone help me get the syntax in the right order. Thanks.
Sub rows()
If Range("m3").Value = "yes" Then
i = 2
Do Until i = 14
With Sheets(i)
.rows("9:300").EntireRow.Hidden = True
End With
If ActiveCell.Value = "data" Then
ActiveCell.EntireRow.Hidden = False
End If
i = i + 1
Loop
End If
Sub rows()
If Range("m3").Value = "yes" Then
i = 2
Do Until i = 14
With Sheets(i)
.rows("9:300").EntireRow.Hidden = True
End With
If ActiveCell.Value = "data" Then
ActiveCell.EntireRow.Hidden = False
End If
i = i + 1
Loop
End If