Private Sub Worksheet_Change(ByVal Target As Range)
If [B1] & [B4] = "" Then Columns.Hidden = False: Exit Sub 'affiche tout
Application.ScreenUpdating = False
Application.EnableEvents = False 'désactive les évènements
On Error Resume Next
With Range("A1", UsedRange)
With .Columns(3).Resize(, .Columns.Count - 2)
.Rows(4).Replace [B1], "#N/A", xlWhole
.Rows(5).Replace [B4], "#N/A"
.Hidden = True 'masque
.SpecialCells(xlCellTypeConstants, 16).EntireColumn.Hidden = False 'affiche
.Rows(4).Replace "#N/A", [B1]
.Rows(5).Replace "#N/A", [B4]
End With
End With
Application.EnableEvents = True 'réactive les évènements
End Sub