Hello
I try to populate values in textbox based on select optionbuttonS after select combobox.
so should brings the values from cloumn F when select combobox1 and optionbutton1 into textbox1,and if I select combobox1 and optionbutton2 should brings the values from cloumn G and populate into textbox1.
How can I do that ,please
I try to populate values in textbox based on select optionbuttonS after select combobox.
so should brings the values from cloumn F when select combobox1 and optionbutton1 into textbox1,and if I select combobox1 and optionbutton2 should brings the values from cloumn G and populate into textbox1.
VBA Code:
Private Sub ComboBox1_Change()
Dim c As Range
With Sheets("BS")
Set c = .Range("B:B").Find(What:=ComboBox1.Value, LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If OptionButton1.Value = True Then
If Not c Is Nothing Then
ComboBox2.Value = c.Offset(, 1).Value
ComboBox3.Value = c.Offset(, 2).Value
ComboBox4.Value = c.Offset(, 3).Value
TextBox1.Value = c.Offset(, 5).Value
ElseIf OptionButton2.Value = True Then
If Not c Is Nothing Then
ComboBox2.Value = c.Offset(, 1).Value
ComboBox3.Value = c.Offset(, 2).Value
ComboBox4.Value = c.Offset(, 3).Value
TextBox1.Value = c.Offset(, 6).Value
End If
End If
End If
End With
End Sub