Hide row

T

tommyboy

Is there a workshhet change code i can use to hide a row if the 5 row
below have complete data in sat a,b and c

so at any time there is only 5 rows visable and when another row i
completed the row at the top gets hidde
 
J

jeff

Hi,

Play with this code. I think it's close:

Jeff

Sub HideRow()
Dim more, foundValues As Boolean
Dim cRow, LastRow As Long
LastRow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
more = True
cRow = 2
While more
foundValues = False
f = 0
For j = 1 To 5
For k = 1 To 3
If Range(Cells(cRow + j, k), Cells(cRow + j,
k)).Value <> "" Then f = f + 1
Next k
Next j
If f = 15 Then ActiveSheet.Rows(cRow).Hidden = True
cRow = cRow + 1
If cRow > LastRow Then more = False
Wend
End Sub

Private Sub Worksheet_Change(ByVal Target As Range)
HideRow
End Sub
 
Top