Re : fonction "ou" en vba
bon ça marche bien merci beaucoup Robert
voila le code complet modifier:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$E$3" Then Exit Sub
Application.EnableEvents = False
tx = [E3]
lig = 8
[A8:J400].ClearContents
'Stop
Set plage = Sheets("base de donnée").Range("T2:T90")
For Each cel In plage
flag = 0
k = cel.Value
If k = "" Then Application.EnableEvents = True: Exit Sub
'Stop
For Each sh In ActiveWorkbook.Sheets
If sh.Name = k Then A = sh.Name: flag = 1: Exit For
Next sh
If flag = 0 Then MsgBox ("La feuille " & k & " n'existe pas, Faire les modif nécessaires"): Application.EnableEvents = True: Exit Sub
With Sheets(k).[L17:m96]
Set A = .Find(tx, LookIn:=xlValues)
If Not A Is Nothing Then
PA = A.Address
Do
If A.Row = LI Then GoTo suite
LI = A.Row
Cells(lig, 1) = Sheets(k).Cells(A.Row, 1)
Cells(lig, 2) = Sheets(k).Cells(A.Row, 2)
Cells(lig, 3) = Sheets(k).Cells(A.Row, 3)
Cells(lig, 4) = Sheets(k).Cells(A.Row, 4)
Cells(lig, 5) = Sheets(k).Cells(A.Row, 5)
Cells(lig, 6) = Sheets(k).Cells(A.Row, 6)
Cells(lig, 7) = Sheets(k).Cells(A.Row, 7)
Cells(lig, 8) = Sheets(k).Cells(A.Row, 8)
Cells(lig, 9) = Sheets(k).Cells(A.Row, 9)
lig = lig + 1
suite:
Set A = .FindNext(A)
Loop While Not A Is Nothing And A.Address <> PA
End If
End With
'End If
Next
Application.EnableEvents = True
End Sub
et je joint le fichier
Merci encore Bonne journée
Alain