PDA

View Full Version : Solved: Unhide 5 Rows below when entering date Row Above



guatelize
11-10-2010, 07:12 AM
Hi everybody
I have a database with some formulas and extended cond. formats.
Every time a new customer is inserted and has reached the last row of range A, the 5 rows below should be unhided. Also, when the last customer is deleted from the list the rows beneath should be hidden. I want to prevent that rows are inserted without the formulas and formats in the different columns, avoiding miscalculations at the end.
A file with an example is added :

Bob Phillips
11-10-2010, 10:52 AM
This will do the unhiding, but I don't get the part about hiding, or how formulas come into play



Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Me.Range("B1")) Is Nothing Then

Me.Range("D1").Value2 = ""
If Target.Value2 = "" Then Exit Sub
Range("D1").Select
SendKeys "%{DOWN}"
ElseIf Not Intersect(Target, Me.Columns("a")) Is Nothing Then

If Target.Row < 9 Then Exit Sub

If Me.Rows(Target.Row + 1).Hidden Then

Me.Rows(Target.Row + 1).Resize(5).Hidden = False
End If
End If
End Sub

guatelize
11-15-2010, 02:38 AM
That is what I was looking for.
Thank you very much