= Range ("Beg" & num). Row + 1 To ie
If CStr (Cells (ib, 1). Value) = ComboBox1.Value And Cells (ib, 1). MergeCells = True Then flag = 1
Next ib
If flag = 0 Then
MsgBox "У базі немає такої країни!", vbOKOnly, "Помилка!"
Exit Sub
End If
If TextBox3.Text = "" Then
MsgBox "Введіть необхідні поля введення!", vbOKOnly, "Помилка!"
Exit Sub
End If
В
For ib = Range ("Beg" & num). Row + 1 To ie
If Cells (ib, 1) = ComboBox1.Value And Cells (ib, 1). MergeCells = True Then
temp = ib 'початок країни
Exit For
End If
Next ib
temp2 = temp
temp = temp + 1
Do While Cells (temp, 1). MergeCells = False And temp <> Range ("End" & num). Row
If Cells (temp, 1). Value = TextBox3.Text Then
MsgBox "У базі є місто для вибраної країни!", vbOKOnly, "Помилка!"
TextBox3.Text = ""
Exit Sub
End If
temp = temp + 1
Loop
Cells (temp2 + 1, 1). Select
Selection.EntireRow.Insert
Cells (temp2 + 1, 1). Value = TextBox3.Text
Range (Cells (temp2 + 1, 1), Cells (temp2 + 1, 10)). Select
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 = xlThin
. ColorIndex = xlAutomatic
End With
With Selection.Borders (xlEdgeRight)
. LineStyle = xlContinuous
. Weight = xlMedium
. ColorIndex = xlAutomatic
End With
With Selection.Borders (xlInsideVertical)
. LineStyle = xlContinuous
. Weight = xlThin
. ColorIndex = xlAutomatic
End With
Me.Hide
frmPInfo.Label1.Caption = ActiveSheet.Name
frmPInfo.TextBox1.Text = frmNewPut.ComboBox1.Value
frmPInfo.TextBox2.Text = frmNewPut.TextBox3.Text
ex = 1
frmPInfo.Show
With frmPInfo
If. TextBox5.Value = "" Then. TextBox5.Value = 0
If. TextBox6.Value = "" Then. TextBox6.Value = 0
If. TextBox7.Value = "" Then. TextBox7.Value = 0
If. TextBox3.Value = "" Then. TextBox3.Value = 0
If. TextBox4.Value = "" Then. TextBox4.Value = 0
Cells (temp2 + 1, 3). Value = CDbl (. TextBox5.Value)
Cells (temp2 + 1, 5). Value = CDbl (. TextBox6.Text)
Cells (temp2 + 1, 6). Value = CDbl (. TextBox7.Text)
Cells (temp2 + 1, 2). Value = CInt (. TextBox3.Text)
Cells (temp2 + 1, 4). Value = CInt (....