J
John
Is it possible to create a macro that copies a text value from one text box
on a word form to a second box on a page further down the document when a
command button is clicked.
I have so far tried a simple macro of the type;
Private Sub UserForm_Initialize()
TextBox1.Text = ""
TextBox2.Text = ""
CommandButton1.Caption = "Cut and Paste"
CommandButton1.AutoSize = True
End Sub
Private Sub CommandButton1_Click()
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.Paste
TextBox1.SelStart = 0
End Sub
Where am I going wrong?
on a word form to a second box on a page further down the document when a
command button is clicked.
I have so far tried a simple macro of the type;
Private Sub UserForm_Initialize()
TextBox1.Text = ""
TextBox2.Text = ""
CommandButton1.Caption = "Cut and Paste"
CommandButton1.AutoSize = True
End Sub
Private Sub CommandButton1_Click()
TextBox1.SelStart = 0
TextBox1.SelLength = TextBox1.TextLength
TextBox1.Copy
TextBox2.SetFocus
TextBox2.SelStart = 0
TextBox2.Paste
TextBox1.SelStart = 0
End Sub
Where am I going wrong?