Re,
Pouvez-vous m'indiquer quelle macro mettre en place pour obtenir un tel résultat ? J'ai beau chercher dans le menu "macro" votre fichier je n'en trouve pas.
Le code est dans le module de la feuille concernée,
J'ai essayé de le simplifier...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lig%, derlig%
Application.ScreenUpdating = False
If Not Application.Intersect(Target, [B2]) Is Nothing Then
cancel = True
With ActiveSheet.ListObjects("Tableau1")
If .InsertRowRange Is Nothing Then
Set rcell = .HeaderRowRange.Cells(1).Offset(.ListRows.Count + 1)
Else
Set rcell = .InsertRowRange.Cells(1)
End If
lig = .HeaderRowRange.Row + 1: derlig = rcell.Row - 1 'première et dernière ligne du tableau de données
For i = lig To derlig
Rows(i).Hidden = IIf(Target.Value <> "" And .DataBodyRange(i - 4, 3).Value <> Target.Value And .DataBodyRange(i - 4, 6).Value <> Target.Value, True, False)
Next i
End With
End If
End Sub
Cordialement,