1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$A$2" Then Exit Sub
Dim Tablo
Dim derlig As Long
Dim i As Long
Dim j As Long
Dim L As Integer
derlig = Cells(Rows.Count, 1).End(xlUp).Row
If derlig > 8 Then Range("A9:D" & derlig).ClearContents
L = 9
Tablo = Sheets("INSCRITS").Range("D3", "G" & Sheets("INSCRITS").Range("G" & Rows.Count).End(xlUp).Row)
With Sheets("MENU ACCUEIL")
For i = LBound(Tablo, 1) To UBound(Tablo, 1)
If IsNumeric(Application.Match(CStr(Tablo(i, 3)), .Cells(2, 1), 0)) Then
.Cells(L, "A") = Tablo(i, 1)
.Cells(L, "B") = Tablo(i, 2)
.Cells(L, "C") = Tablo(i, 3)
.Cells(L, "D") = Tablo(i, 4)
End If
If .Cells(L, "A") <> "" Then L = L + 1
Next i
End With
End Sub |
Partager