View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shauna Koppang Shauna Koppang is offline
external usenet poster
 
Posts: 24
Default TextBox Coding Help

Sorry but I am just a newbie to Visual basic.

I have a worksheet (Sheet 1) into which I have created a
User form with 2 text boxes (TextBox1, TextBox2) and 1
command button (CommandButton1).

In the results of these boxes need to go into specific
cells. Eg. TextBox1 into A1 and TextBox2 into A3 when the
command button is clicked.

So... found in help the coding below that I placed into
declarations of Sheet 1 in the file called Test.xlt. It
does not display the form when I create a new document
based on Test.xlt and I do not know how to get the coding
to place the results in a cell. If you could also direct
me to either a good beginner VBA site for Excel or a good
book for a rank beginner, I would be grateful!

Private Sub UserForm_Initialize()
TextBox1.Text = "From TextBox1!"
TextBox2.Text = "Hello "

CommandButton1.Caption = "Cut and Paste"
CommandButton1.AutoSize = True
End Sub

Private Sub CommandButton1_Click()
TextBox2.SelStart = 0
TextBox2.SelLength = TextBox2.TextLength
TextBox2.Cut

TextBox1.SetFocus
TextBox1.SelStart = 0

TextBox1.Paste
TextBox2.SelStart = 0
End Sub


So how do I modify the above??? Help!

Thanks!
Shauna