ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   HOW TO AUTOMATICALLY HIDE A LINE (https://www.excelbanter.com/excel-discussion-misc-queries/217516-how-automatically-hide-line.html)

Mike H[_4_]

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?


shadow

HOW TO AUTOMATICALLY HIDE A LINE
 
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?


--
SHADOW SDM

Gord Dibben

HOW TO AUTOMATICALLY HIDE A LINE
 
Yes, it is possible using event code or a macro.

How is the value of the "certain cell" derived?

By calculation or by manual input?

Drop the Caps Lock and post back with details...........certain cell
address, which row to hide and answer to questions above.


Gord Dibben MS Excel MVP


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?




All times are GMT +1. The time now is 08:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com