Цитата:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then
Target.Interior.ColorIndex = xlNone: Exit Sub
End If
Dim x As Range, s As String
s = Application.Trim(Replace(Split(Targ et, "-")(0), "", ""))
Set x = Sheets(2).[A:A].Find(Split(s, " ")(0))
If x Is Nothing Then Exit Sub
If x.Interior.ColorIndex <> xlNone Then
Target.Interior.ColorIndex = x.Interior.ColorIndex
Target.Font.ColorIndex = x.Font.ColorIndex
Target.Font.Bold = x.Font.Bold
End If
End Sub
|
Этот самый лучший - 2 вариант сильно тормозит