View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Mike H[_4_] Mike H[_4_] is offline
external usenet poster
 
Posts: 19
Default HOW TO AUTOMATICALLY HIDE A LINE

Hi,

Yes that's possible but it's best to ask how with the caps lock turned
off. It's considered to be shouting and makes the post difficult to
read.

This looks at column A1 to A10 and if the text "A certain value" is
entered the row becomes hidden

Right click your sheet tab, view code and paste the code in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A1:A10")) Is Nothing Then
Application.EnableEvents = False
If Target.Value = "A certain value" Then
Target.EntireRow.Hidden = True
End If
Application.EnableEvents = True
End If
End Sub

Mike

On Thu, 22 Jan 2009 12:15:01 -0800, SHADOW
wrote:

IS IT POSIBLE IN AN EXCEL WORK SHEET
TO ARRANGE WHETHER A LINE WILL BE AUTOMATICALY HIDDEN OR UNHIDDEN
BASED ON THE VALUE OF A CERTAIN CELL?