ed = False
TextBox3.Enabled = FalseSubSub CommandButton2_Click ()
'нове місто
num = ActiveSheet.Index
If Range ("End" & num). Row = 6 Then
MsgBox "У базі немає жодної країни ...", vbOKOnly, "Помилка!"
CommandButton1_Click
Exit Sub
End If
Label3.Enabled = True
Label4.Enabled = True
ComboBox1.Enabled = True
TextBox1.Enabled = False
TextBox2.Enabled = False
TextBox3.Enabled = True
CommandButton3.Enabled = False
CommandButton4.Enabled = True
'ComboBox1.MatchRequired = True
'ComboBox1.MatchEntry = fmMatchEntryComplete
CommandButton2.Caption = "Додати путівку (нове місто)-вибрано"
CommandButton1.Caption = "Додати путівку" & Chr (13) & "(нова країна і місто)"
num = ActiveSheet.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 CommandButton3_Click () 'нова країна і місто
num = ActiveSheet.Index
ie = Range ("End" & num). Row
For ib = Range ("Beg" & num). Row + 1 To ie
If Cells (ib, 1). Value = TextBox1.Text And Cells (ib, 1). MergeCells = True Then
MsgBox "У базі є така країна для цієї фірми!", vbOKOnly, "Помилка!"
TextBox1.Text = ""
Exit Sub
End If
Next ib
If TextBox1.Text = "" Or TextBox2.Text = "" Then
MsgBox "Введіть необхідні поля введення!", vbOKOnly, "Помилка!"
Exit Sub
End If
Range ("End" & Worksheets (ActiveSheet.Name). Index). Select
Selection.EntireRow.Insert
Selection.EntireRow.Insert
ie = Range ("End" & num). Row
Range (Cells (ie - 2, 1), Cells (ie - 1, 10)). Select
Selection.Interior.ColorIndex = xlNone
Range (Cells (ie - 2, 1), Cells (ie - 2, 10)). Select
With Selection
. HorizontalAlignment = xlCenter
. VerticalAlignment = xlCenter
. WrapText = True
. Orientation = 0
. AddIndent = False
. IndentLevel = 0
. ShrinkToFit = False
. ReadingOrder = xlContext
. MergeCells = False
End With
Selection.Merge
Selection.Borders (xlDiagonalDown). LineStyle = xlNone
Selection.Borders (xlDiagonalUp). LineStyle = xlNone
With Selection.Borders (xlEdgeLeft)
. LineStyle = xlContinuous
. Weight = xlMedium
. ColorIndex = xlAutomatic
End With
With Selection.Borders (xlEdgeTop)
. LineStyle = xlContinuous
. Weight = xlMedium
. ColorIndex = xlAutomatic
End With
With Selection.Borders (xlEdgeBottom)
. LineStyle = xlContinuous
. Weight = xlMedium
. ColorIndex = xlAutomatic
...