Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

export text from a textbox to a worksheet

Status
Not open for further replies.

Joep1972

Technical User
Nov 24, 2002
13
NL
Hi Guys,

can somebody help me with the following I've checked the previous questions on the forum and also some books and the help menu but nothing so far,

I hope you can help me,

I've created a userform in this userform i've got a calender

and a text box

How can I get this information that has been filled in the user form exported to a worksheet (called test)after "clicked ok" on the commandbutton.

in two different cells (range h14 for the text and i14 for the date.

many many thanks

Joep
 
sub OKbutton_click()
sheets("test").range("H14")=MyText 'name of your txtbox
sheets("test").range("I14")=MyDate
unload me
end sub

Rob
[flowerface]
 
Joep,

I'm not familiar with the calendar control, but here is an example for transfering from the textbox to worksheet:

Code:
Private Sub CommandButton1_Click()
  Worksheets("Test").Cells(14,8).Value = Me.TextBox1.Text
End Sub

Notes:
- Me represents the Userform containing the textbox control.
- Cells(14,8) = cell H14


HTH
Mike
 
Hey, I just stepped in from a boring meeting - now I gotta run again :)
Rob
[flowerface]
 
He Guys,

I've got the following,

Private Sub CommandButton3_Click()
Worksheets("Test").Cells(14, 8).Value = Me.TextBox1.Text
Sheets("test").Cells(14, 9) = Me.Calendar1.Day
Unload Me
End Sub

and this working fine,

If I now want to go to the specific worksheet test what do I've got to add?

because the userform will "pop-up"in an other worksheet but when the information has been filled in I want to go to the
another worksheet (test)

Joep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top