PDA

View Full Version : Solved: Hide row with a 1 on selection change



jrb
10-28-2009, 06:24 PM
I am trying to get this done, but it turns out it hides only row 1 no matter what cell in column A I change to a 1. Any ideas what I am missing?



Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Set rng = Target.Parent.Range("A:A")
If Target.Count > 1 Then Exit Sub
If Intersect(Target, rng) = 1 Then
Rows(rng.Row).EntireRow.Hidden = True
End If
End Sub

lenze
10-28-2009, 06:48 PM
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Exit Sub
If Target.Column <> 1 Then Exit Sub
If Target = 1 then Cells(Target.Row,"A").EntireRow.Hidden = True
End Sub
Why not a DoubleCLick instead??
lenze

jrb
10-28-2009, 06:57 PM
If it was just me using this sheet I would say the double click is great, but I think the on change would work better. Thanks for the help.

Aussiebear
10-28-2009, 07:02 PM
Has this solved the issue for you Jack?

jrb
10-28-2009, 07:09 PM
Yes and marked solved...Thanks for the reminder.