Userform / textbox data to sheet example request.

dbmathis

Well-known Member
Joined
Sep 22, 2002
Messages
1,064
Hi all,

I have created a userform (transEntry) and I am seeking an example of taking the data that has been entered into a textbox on the userform and copying it into a cell on my sheet.

The Submit button on the userforn is: CommandButton1
An example text box is: TextBox2

What I am hoping I can get to happen is there will be text in TextBox2 and when someone clicks the Submit button (CommandButton1), the text in TextBox2 is copied to some cell on my sheet1 (Ex: M17).

Then after the submit button has been pushed and the data copied, then the userform (transEntry) is cleared out.

Would someone mind creating an example for me?

Thanks
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Something like this perhaps.
Code:
Private Sub CommandButton1_Click()
    Range("M17").Value = Textbox2.Text
    Textbox2.Text = ""
End Sub
 
Upvote 0
This question is related to this thread so I will ask it here.

Consider that there is a column of data, I2 thru I212, and cells I2 thru I100 contain data.

Rather than posting the data for Textbox2 into a static cell like M17. How would I modify Norie's VBA to start in cell I212 and search upward until a cell with data in it's found (in this example: I100) and then paste the data that's in Textbox2 six cell to the left of it (which would be in this example C100)?
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top