End If
If flag2 = 1 And flag = 1 Then
If. Cells (beg, 5). Value> = CDbl (TextBox4.Text) And _
. Cells (beg, 5). Value <= CDbl (TextBox5.Text) And _
. Cells (beg, 3). Value> = CDbl (TextBox2.Text) And _
. Cells (beg, 3). Value <= CDbl (TextBox3.Text) Then
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 1). Value = Sheet.Name
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 2). Value = ComboBox2.Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 3). Value = ComboBox3.Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 4). Value =. Cells (beg, 2). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 5). Value =. Cells (beg, 3). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 6). Value =. Cells (beg, 4). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 7). Value =. Cells (beg, 5). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 8). Value =. Cells (beg, 6). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 9). Value =. Cells (beg, 7). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 10). Value =. Cells (beg, 8). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 11). Value =. Cells (beg, 9). Value
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 12). Value =. Cells (beg, 10). Value
Оформити i, maxi
i = i + 1
Exit For
End If
End If
End If
Next beg
End With
End If
End If
Next Sheet
Me.Hide
End If
'якщо обрана країна і місто
If ComboBox1.Value = "" And ComboBox2.Value <> "" _
And ComboBox3.Value <> "" And TextBox2.Text = "" _
And TextBox3.Text = "" And TextBox4.Text = "" _
And TextBox5.Text = "" Then
For Each Sheet In Workbooks ("Firms.xls"). Worksheets
k = 0
If Sheet.Name <> "1" Then
num = Workbooks ("Firms.xls"). Worksheets (Sheet.Name). Index
ie = Workbooks ("Firms.xls"). Worksheets (Sheet.Name). Range ("End" & num). Row
If ie <> 6 Then
With Workbooks ("Firms.xls"). Worksheets (Sheet.Name)
For ib =. Range ("Beg" & num). Row + 1 To ie
If ComboBox2.Value = CStr (. Cells (ib, 1). Value) And. Cells (ib, 1). MergeCells = True Then
k =. Cells (ib, 1). Row
Exit For
End If
Next ib
k = k + 1
For ib = k To ie
If. Cells (ib, 1). MergeCells = False And ib <> ie And _
ComboBox3.Value = CStr (. Cells (ib, 1). Value) Then
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 1). Value = Sheet.Name
Workbooks ("Main.xls"). Worksheets ("ПоіскПутевкі"). Cells (i, 2...