Hide row

  • Thread starter Thread starter tommyboy
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top