ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet update from UserForm (https://www.excelbanter.com/excel-programming/319615-worksheet-update-userform.html)

Patrick Simonds

Worksheet update from UserForm
 
I have a userform which has a number of lines like the ones below. Currently
these values are placed on the worksheet after I click a commandbutton
(finished). What I would like is for the data to be placed on the worksheet
as I move from one textbox to the next. Is this possible?


rng(1, 47).Value = TextBox1.Text
rng(1, 48).Value = TextBox2.Text
rng(1, 53).Value = TextBox4.Text
rng(1, 54).Value = TextBox5.Text
rng(1, 71).Value = TextBox7.Text
rng(1, 59).Value = TextBox8.Text
rng(1, 60).Value = TextBox9.Text



Vasant Nanavati

Worksheet update from UserForm
 
Yes. Just put the code in the Exit event of the TextBox.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Sheet1.Cells(1, 47).Value = TextBox1.Text
End Sub


--

Vasant

"Patrick Simonds" wrote in message
...
I have a userform which has a number of lines like the ones below.

Currently
these values are placed on the worksheet after I click a commandbutton
(finished). What I would like is for the data to be placed on the

worksheet
as I move from one textbox to the next. Is this possible?


rng(1, 47).Value = TextBox1.Text
rng(1, 48).Value = TextBox2.Text
rng(1, 53).Value = TextBox4.Text
rng(1, 54).Value = TextBox5.Text
rng(1, 71).Value = TextBox7.Text
rng(1, 59).Value = TextBox8.Text
rng(1, 60).Value = TextBox9.Text






All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com