Уважаемые форумчане!
Заполняю таблицу при помощи формы. На кнопке "Ввести данные" следующий код:
Private Sub ВнестиДанные_Click()
ScreenUpdating = False
n = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(n, 1).Value = Label8.Caption
Cells(n, "g").Value = TextBox1.Value
Cells(n, "c").Value = TextBox2.Value
Cells(n, "b").Value = Cells(ActiveCell.Row, "b").Value
Cells(n, "d").Value = Cells(ActiveCell.Row, "d").Value
Cells(n, "e").Value = Cells(ActiveCell.Row, "e").Value
Cells(n, "f").Value = Cells(ActiveCell.Row, "f").Value
Cells(n, "j").Value = Cells(ActiveCell.Row, "j").Value
Cells(n, "k").Value = Cells(ActiveCell.Row, "k").Value
Cells(n, "l").Value = Cells(ActiveCell.Row, "l").Value
Cells(n, "m").Value = Cells(ActiveCell.Row, "m").Value
Cells(n, "n").Value = Cells(ActiveCell.Row, "n").Value
Cells(n, "o").Value = Cells(ActiveCell.Row, "o").Value
Cells(n, "p").Value = Cells(ActiveCell.Row, "p").Value
Cells(n, "q").Value = Cells(ActiveCell.Row, "q").Value
Cells(n, "s").Value = "текст"
Cells(n, "t").Value = ComboBox2.Value
Cells(n, "u").Value = ComboBox1.Value
Cells(n, "v").Value = Val(TextBox3.Value)
Cells(n, "w").Value = TextBox4.Value
Cells(n, "x").Value = TextBox6.Value
Cells(n, "y").Value = TextBox5.Value
ScreenUpdating = True
End Sub
Данные вносятся, но происходит это в течение нескольких минут.
Можете подсказать, в чем загвоздка?
Заполняю таблицу при помощи формы. На кнопке "Ввести данные" следующий код:
Private Sub ВнестиДанные_Click()
ScreenUpdating = False
n = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(n, 1).Value = Label8.Caption
Cells(n, "g").Value = TextBox1.Value
Cells(n, "c").Value = TextBox2.Value
Cells(n, "b").Value = Cells(ActiveCell.Row, "b").Value
Cells(n, "d").Value = Cells(ActiveCell.Row, "d").Value
Cells(n, "e").Value = Cells(ActiveCell.Row, "e").Value
Cells(n, "f").Value = Cells(ActiveCell.Row, "f").Value
Cells(n, "j").Value = Cells(ActiveCell.Row, "j").Value
Cells(n, "k").Value = Cells(ActiveCell.Row, "k").Value
Cells(n, "l").Value = Cells(ActiveCell.Row, "l").Value
Cells(n, "m").Value = Cells(ActiveCell.Row, "m").Value
Cells(n, "n").Value = Cells(ActiveCell.Row, "n").Value
Cells(n, "o").Value = Cells(ActiveCell.Row, "o").Value
Cells(n, "p").Value = Cells(ActiveCell.Row, "p").Value
Cells(n, "q").Value = Cells(ActiveCell.Row, "q").Value
Cells(n, "s").Value = "текст"
Cells(n, "t").Value = ComboBox2.Value
Cells(n, "u").Value = ComboBox1.Value
Cells(n, "v").Value = Val(TextBox3.Value)
Cells(n, "w").Value = TextBox4.Value
Cells(n, "x").Value = TextBox6.Value
Cells(n, "y").Value = TextBox5.Value
ScreenUpdating = True
End Sub
Данные вносятся, но происходит это в течение нескольких минут.
Можете подсказать, в чем загвоздка?