Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 10 Then
MajListe
Exit Sub
End If
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Set cel = Range("J:J").Find(Target.Value, LookIn:=xlValues, lookat:=xlWhole)
If cel Is Nothing Then
Range("D" & Target.Row & ":F" & Target.Row).Font.ColorIndex = xlAutomatic
Range("D" & Target.Row & ":F" & Target.Row).Font.Bold = False
Exit Sub
End If
Range("D" & Target.Row) = cel.Value
cel.Copy
Range("D" & Target.Row & ":F" & Target.Row).Font.ColorIndex = cel.Font.ColorIndex
Range("D" & Target.Row & ":F" & Target.Row).Font.Bold = True
End If
End Sub
Sub MajListe()
Range("J3:J" & Range("J65536").End(xlUp).Row).Sort Key1:=Range("J3"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
With Range("D2:D65536").Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=$J$2:$J$" & Range("J65536").End(xlUp).Row
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
End Sub