Looking for a macro to do the following.
In Sheet1 Change Event
Look in Range (a6:a50)
If value is ""
Clear existing data in Row, from Column B to P.
Then Hide entire row.
Thanks.
Clear and Hide Empty Rows
-
- 3StarLounger
- Posts: 206
- Joined: 31 Dec 2010, 22:23
- Location: Columbia Falls, MT
-
- Administrator
- Posts: 78501
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Clear and Hide Empty Rows
This code goes into the worksheet module:
Code: Select all
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
If Not Intersect(Range("A6:A50"), Target) Is Nothing Then
Application.EnableEvents = False
For Each rng In Intersect(Range("A6:A50"), Target)
If rng.Value = "" Then
rng.Offset(0, 1).Resize(1, 15).ClearContents
rng.EntireRow.Hidden = True
End If
Next rng
Application.EnableEvents = True
End If
End Sub
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 206
- Joined: 31 Dec 2010, 22:23
- Location: Columbia Falls, MT
Re: Clear and Hide Empty Rows
Perfect!! Works mint, thanks Hans.