abdelfattah
Well-known Member
- Joined
- May 3, 2019
- Messages
- 1,429
- Office Version
- 2019
- 2010
- Platform
- Windows
hello
I need help about find way to populate data in textbox based on select from combo box it works only combobox1 & textbox1
what I want the rests of combobox when I select item then populate in textbox
thanks
I need help about find way to populate data in textbox based on select from combo box it works only combobox1 & textbox1
what I want the rests of combobox when I select item then populate in textbox
VBA Code:
Private Sub ComboBox1_Change()
Me.TextBox1.Value = Sheets("Sheet1").Range("e" & Me.ComboBox1.ListIndex + 2).Value
Me.TextBox2.Value = Sheets("Sheet1").Range("e" & Me.ComboBox2.ListIndex + 2).Value
Me.TextBox3.Value = Sheets("Sheet1").Range("e" & Me.ComboBox3.ListIndex + 2).Value
Me.TextBox4.Value = Sheets("Sheet1").Range("e" & Me.ComboBox4.ListIndex + 2).Value
End Sub
Private Sub UserForm_Initialize()
With Sheets("Sheet1")
Me.ComboBox1.List = .Range("b2:b" & .Range("A" & Rows.Count).End(xlUp).Row).Value
Me.ComboBox2.List = .Range("b2:b" & .Range("A" & Rows.Count).End(xlUp).Row).Value
Me.ComboBox3.List = .Range("b2:b" & .Range("A" & Rows.Count).End(xlUp).Row).Value
Me.ComboBox4.List = .Range("b2:b" & .Range("A" & Rows.Count).End(xlUp).Row).Value
End With
End Sub