For ii To kk Count For To whos_going UsedRange Rows Count If whos_goin

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
For ii = 2 To kk - 1
Count = 0
For i = 2 To whos_going.UsedRange.Rows.Count
If (whos_going.Cells(i, 1).Value = komandir.Cells(ii, 12)) Then
whos_going.Cells(i, 4).Value = "зарубежная"
End If
Next i
For i1 = 2 To whos_going.UsedRange.Rows.Count
If (whos_going.Cells(i1, 4).Value = "зарубежная") Then
For j = 1 To temp_list.UsedRange.Rows.Count
If (whos_going.Cells(i1, 2).Value = temp_list.Cells(j, 1)) Then
whos_going.Cells(i1, 3).Value = temp_list.Cells(j, 2)
Count = Count + 1
End If
Next j
End If
Next i1
Next ii
For ii = 2 To kk - 1
' Count = 0
For i1 = 2 To whos_going.UsedRange.Rows.Count
If (whos_going.Cells(i1, 4).Value = "зарубежная") Then
For j = 1 To temp_list.UsedRange.Rows.Count
If (whos_going.Cells(i1, 2).Value = temp_list.Cells(j, 1)) Then
whos_going.Cells(i1, 3).Value = temp_list.Cells(j, 2)
Count = Count + 1
' whos_going.Cells(i1, 5).Value = Count
End If
' Count = Count + 1
whos_going.Cells(i1, 5).Value = Count
Next j
End If
Count = 0
Next i1
Next ii