# Copy & Paste from a User Form VBA



## exceled (Jun 12, 2007)

I created a User form in excel 2003, with a Text box and command button. When the form runs I want to enter text into the text box and when I press the command button, I want the text to be copied to an Excel spreedsheet cell.


----------



## OBP (Mar 8, 2005)

You would be better off posting this question on the Business Applications Forum, that is where the "Excel" guys answer Excel questions.


----------



## Rollin_Again (Sep 4, 2003)

In the form's design view just double click the command button and the button_click sub will open. Just add your code there. Just replace Sheet1 with your actual sheetname, replace A1 with your actual cell, replace Form1 with your actual form name, replace Textbox1 with the actual name of your textbox.


```
Sheets("Sheet1").Range("A1").Value = Form1.Textbox1.Text
```
Cheers,
Rollin


----------

