• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

a macro to auto hide & unhide rows

moune75

New Member
Hello,
Please help me,
I want a macro to auto hide rows if cells in column (i) contain zero (0)
and auto unhide when it be (1)

Thank You So Much :)
 
moune75
As You asked about Macro ... then this thread should be in VBA Macros ... (in this time moved there).
One sample code base Your writing; save it in ThisWorkbook:
Code:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    On Error Resume Next
    With ActiveSheet
        If Target.Column = 9 Then
            erh = 11
            Select Case Target.Value
                Case 0
                    If Len(Target.Value) > 0 Then erh = True
                Case 1
                    erh = False
            End Select
            If erh <> 11 Then .Cells(Target.Row, 1).EntireRow.Hidden = erh
        End If
    End With
End Sub
 
Back
Top