Hi,
I need a way (if at all possible) to take information in cells on my worksheet and transferring them into textboxes and checkboxes on a userform. I thought the below code would work for sure but it doesn't
. To explain what i am doing - I have a table with information. There are lets say... "Colour" on the left side (Col A) and "Fruits" on the top rows. Each "Fruit" will have 3 columns of information relating to the fruit. I need to be able to choose a colour in a userform combobox, then choose any fruits that are that colour from a second combo box and have a button or a combobox_change event that runs and looks at the 3 pieces of information related to each "fruit" and transfers one piece of information to a textbox and another piece of information to a checkbox.
Private Sub CommandButton2_Click()
Dim UpdateRange As Range
Dim rngRowFind As Range, rngColFind As Range
Sheets("Detail").Activate
Set rngRowFind = Range("A1:A50").Find(Combobox2.Value, LookIn:=xlValues)
Set rngColFind = Range("G2:AJ2").Find(Combobox1.Value, LookIn:=xlValues)
If Not rngRowFind Is Nothing And Not rngColFind Is Nothing Then
ActiveCell = Cells(rngRowFind.Row, rngColFind.Column)
Set UpdateRange = Range(ActiveCell, ActiveCell.Offset(0, 2))
UpdateRange(1, 1).Select
TextBox13.Value = UpdateRange(1, 2).Value
If UpdateRange(1, 2).Text = "In Process" Then
CheckBox23.Value = True
ElseIf UpdateRange(1, 2).Text = "Complete" Then
CheckBox22.Value = True
ElseIf UpdateRange(1, 2).Text = "Planned" Then
CheckBox24.Value = True
End If
End If
End Sub
Any help is appreciated
Bookmarks