KOnly, "Помилка!"
ComboBox1.Value = ""
ComboBox2.Value = ""
Exit Sub
End If
flag2 = 0
Do While Cells (temp, 1). MergeCells = False And temp <> Range ("End" & num). Row
If ComboBox2.Value = CStr (Cells (temp, 1). Value) Then
flag2 = 1
Exit Do
End If
temp = temp + 1
Loop
If flag2 = 0 Then
MsgBox "Немає такого міста для цієї країни в списку ...", vbOKOnly, "Помилка!"
ComboBox2.Value = ""
Exit Sub
End If
Range (Cells (temp, 1), Cells (temp, 10)). Select
Me.Hide
End If
If ComboBox1.Value <> "" And ComboBox2.Value = "" Then
For ib = Range ("Beg" & num). Row + 1 To ie
If CStr (Cells (ib, 1). Value) = ComboBox1.Value And Cells (ib, 1). MergeCells = True Then
NR = Cells (ib, 1). Row
flag = 1
Exit For
End If
Next ib
If flag = 0 Then
MsgBox "Немає такої країни в списку ...", vbOKOnly, "Помилка!"
ComboBox1.Value = ""
ComboBox2.Value = ""
Exit Sub
End If
Worksheets (ActiveSheet.Name). Cells (NR, 1). Select
Me.Hide
End IfSubSub UserForm_Activate ()
Workbooks ("Firms"). Unprotect Password: = "Firms1"
ActiveSheet.Unprotect Password: = "list"
ComboBox1.Clear
ComboBox2.Clear
num = Worksheets (ActiveSheet.Name). Index
ie = Range ("End" & num). Row
For ib = Range ("Beg" & num). Row + 1 To ie
If Cells (ib, 1). MergeCells = True Then
ComboBox1.AddItem Cells (ib, 1). Value
End If
Next ibSubSub UserForm_Deactivate ()
ComboBox1.Clear
ComboBox2.ClearSubSub UserForm_QueryClose (Cancel As Integer, CloseMode As Integer)
If Cancel = 0 Then ex = 0Sub
// Workbook (Firms.xls) Форма listFirm
Private Sub CommandButton1_Click ()
flag = 0
For Each Sheet In Workbooks ("Firms.xls"). Worksheets
If Sheet.Name = ComboBox1.Value Then flag = 1
Next Sheet
If flag = 0 Then
MsgBox "Немає такої фірми в базі ...", vbCritical, "Помилка!"
Exit Sub
End If
Me.Hide
Workbooks ("Firms.xls"). Worksheets (ComboBox1.Value). ActivateSubSub UserForm_Activate ()
ComboBox1.Clear
For Each Sheet In Workbooks ("Firms.xls"). Worksheets
If Sheet.Name <> "1" Then
ComboBox1.AddItem Sheet.Name
End If
Next SheetSubSub UserForm_Deactivate ()
ComboBox1.ClearSubSub UserForm_QueryClose (Cancel As Integer, CloseMode As Integer)
If Cancel = 0 Then ex = 0Sub
// Workbook (Firms.xls) Форма NewFirm
Option Compare TextSub cmbOK_Click ()
Dim SA (1 To 7) As Integer
SA (1) = InStr (txtNaim.Text, ":")
SA (2) = InStr (txtNaim.Text, "/")
SA (3) = InStr (tx...