Go to your userform designer, insert the TextBox and CommandButton (dragging from Toolbox), and then double click the added button to go to Click handler. Then enter a code like this:
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Set ws = ActiveSheet
ws.Range("A1").Value = TextBox1.Text
End Sub
(Adjust the names if your controls are called differently). This example copies the text from textbox to A1 cell of current worksheet.