View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Nigel[_3_] Nigel[_3_] is offline
external usenet poster
 
Posts: 31
Default Hiding rows based on cell content

Dim lRow As Long
With Sheets("Bulk MO")

.Unprotect

For lRow = 14 To 50 Step 3
If .Cells(lRow, 1).Value = 0 Then
.Rows(lRow & ":" & lRow + 2).EntireRow.Hidden = True
End If
Next

.Protect

End With


--

Regards,
Nigel




"Doug Howell" wrote in message
...
Sheets("Bulk MO").Visible = True
Sheets("Bulk MO").Select
Sheets("Bulk MO").Unprotect
Dim lRow As Long
For lRow = 14 To 50 Step 3
If Cells(lRow, 1).Value = 0 Then
Rows(lRow & ":" & lRow + 2).EntireRow.Hidden = True
End If
Next
Sheets("Bulk MO").Protect
Sheets("Bulk MO").Visible = False


Gives an error:

Run-time error '1004':
Unable to set the Hidden property of the Range class