Sub Task1 Dim List As Object Dim List2 As Object Set List Worksheets Ê

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Sub Task1()
Dim List As Object
Dim List2 As Object
Set List = Worksheets("Êîìàíäèðîâêè")
Set List2 = Worksheets("Ñïèñîê öåëåé")
Dim i As Integer
lLastCol = List.Cells(2, 1).CurrentRegion.Rows.Count
Dim j As Integer
JLastCol = List2.Cells(2, 1).CurrentRegion.Rows.Count
For i = 2 To lLastCol
For j = 2 To JLastCol
If List.Cells(i, 4) = List2.Cells(j, 1) Then
If List.Cells(i, 3) > List2.Cells(j, 2) Then
List.Cells(i, 3) = List2.Cells(j, 2)
List.Cells(i, 3).Interior.ColorIndex = 36
End If
End If
Next j
Next i
End Sub