Option Explicit
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim lig As Long
Application.EnableEvents = False
Application.ScreenUpdating = False
If Not Intersect(Target, Range("x6:x65536")) Is Nothing And Target.Count = 1 Then
With ActiveSheet
For lig = 6 To .Cells(Rows.Count, "X").End(xlUp).Row
If .Cells(lig, "X").Value >= 18 Then .Rows(lig).Hidden = True
Next lig
End With
End If
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim lig As Long
Application.ScreenUpdating = False
If Not Intersect(Target, Range("z6:z65536")) Is Nothing And Target.Count = 1 Then
With ActiveSheet
For lig = 6 To .Cells(Rows.Count, "X").End(xlUp).Row
If .Rows(lig).Hidden = True Then .Rows(lig).Hidden = False
Next lig
End With
End If
End Sub