1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim LastLigSD As Long, LastLigAD
Application.ScreenUpdating = False
LastLigSD = Cells(Rows.Count, "D").End(xlUp).Row
If Not Intersect(Target, Range("D2:D" & LastLigSD)) Is Nothing Then
With Sheets("BDD avec doublon")
Sheets("Feuil3").UsedRange.Clear
.AutoFilterMode = False
LastLigAD = .Cells(Rows.Count, "D").End(xlUp).Row
.Range("A1:G" & LastLigAD).AutoFilter field:=4, Criteria1:=Target.Cells(1, 1).Value
.Range("A1:G" & LastLigAD).SpecialCells(xlCellTypeVisible).Copy Sheets("Feuil3").Range("A1")
.AutoFilterMode = False
End With
End If
End Sub |
Partager