Основы офисного программирования и язык VBA


Пример 13.2


Option Explicit

Private GlobalName As String

Private Sub CommandButton1_Click ()

Controls (GlobalName). Cut

End Sub

Private Sub CommandButton2_Click ()

Controls (GlobalName). Copy

End Sub

Private Sub CommandButton3_Click ()

Controls (GlobalName). Paste

End Sub

Private Sub TextBox1_Exit (ByVal Cancel As MSForms. ReturnBoolean)

GlobalName = "TextBox1"

Cancel = False

End Sub

Private Sub TextBox2_Exit (ByVal Cancel As MSForms. ReturnBoolean)

GlobalName = "TextBox2"

Cancel = False

End Sub

Private Sub TextBox3_Exit (ByVal Cancel As MSForms. ReturnBoolean)

GlobalName = "TextBox3"

Cancel = False

End Sub

Private Sub UserForm_Initialize ()

TextBox1. Text = "Это мой текст"

TextBox2. Text = "Это ее текст"

TextBox3. Text = "Это его текст"

End Sub




Начало  Назад  Вперед