ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update Textbox1 after combox easy help for beginner! Opzioni (https://www.excelbanter.com/excel-programming/406508-update-textbox1-after-combox-easy-help-beginner-opzioni.html)

piditi

Update Textbox1 after combox easy help for beginner! Opzioni
 
I want only that after I choose in the Combobox1 one value in the
textbox1 appear automatically this value!
I know it s a stupid question...I'm starting know to work with WBA
and
so I' reading a lot!


Sub MACRO22()
UserForm1.Show
UserForm1.ComboBox1.RowSource =
ThisWorkbook.Worksheets("Foglio1").Range("A1:A3"). Address(External:=True)
End Sub


Private Sub ComboBox1_AfterUpdate()
UserForm1.TextBox1.Text = UserForm1.ComboBox1.Value
End Sub

JLGWhiz

Update Textbox1 after combox easy help for beginner! Opzioni
 
If you are putting this code behind the ComboBox control in the code module,
it won't work.

Private Sub ComboBox1_AfterUpdate()
UserForm1.TextBox1.Text = UserForm1.ComboBox1.Value
End Sub


You will need to change it to:

Private Sub ComboBox1_Click()
UserForm1.TextBox1.Text = UserForm1.ComboBox1.Value
End Sub


"piditi" wrote:

I want only that after I choose in the Combobox1 one value in the
textbox1 appear automatically this value!
I know it s a stupid question...I'm starting know to work with WBA
and
so I' reading a lot!


Sub MACRO22()
UserForm1.Show
UserForm1.ComboBox1.RowSource =
ThisWorkbook.Worksheets("Foglio1").Range("A1:A3"). Address(External:=True)
End Sub


Private Sub ComboBox1_AfterUpdate()
UserForm1.TextBox1.Text = UserForm1.ComboBox1.Value
End Sub



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

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