Sub Задание1 Set trips Worksheets Лист1 Set goals Worksheets Лист2 Dim

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
Sub Задание1()
Set trips = Worksheets("Лист1")
Set goals = Worksheets("Лист2")
Dim coll As New Collection
Dim Goal_Row, Trip_Row As Integer
Goal_Row = goals.Cells(2, 1).CurrentRegion.Rows.Count
Trip_Row = trips.Cells(2, 1).CurrentRegion.Rows.Count
For i = 2 To Goal_Row
coll.Add goals.Cells(i, 2), goals.Cells(i, 1)
Next
If coll.Item("Лалала") <> 0 Then
MsgBox ("Есть")
End If
End Sub