i have a work sheet that im trying to build a user for in, that will take the information selected in 3 different combo boxes and use it to find a row that matches that information and then display the information it the columns to the right of it. i can make it return the information im looking for but its only matching the row by the last combo box
this is what i have that will get me more or less what i need but only looks at one of the selected criteria and not all 3
Private Sub combobox3_LostFocus()
Dim LstRw As Long, Rng As Range
If Len(ComboBox3) = 0 Then Exit Sub
Range("C3").Select
LstRw = Cells(Rows.Count, "C").End(xlUp).Row
For Each Rng In Range("c101:C" & LstRw)
If Rng.Value = ComboBox3.Text Then
With UserForm1
.OutPutLabel3.Caption = Rng.Value
.TextBox1.Value = Rng.Offset(0, 1).Text
.TextBox2.Value = Rng.Offset(, 2).Text
.TextBox3.Value = Rng.Offset(, 3).Text
.TextBox4.Value = Rng.Offset(, 4).Text
.TextBox5.Value = Rng.Offset(, 5).Text
.TextBox6.Value = Rng.Offset(, 6).Text
End With
End If
Next Rng
UserForm1.Show
End Sub
this is what i have that will get me more or less what i need but only looks at one of the selected criteria and not all 3
Private Sub combobox3_LostFocus()
Dim LstRw As Long, Rng As Range
If Len(ComboBox3) = 0 Then Exit Sub
Range("C3").Select
LstRw = Cells(Rows.Count, "C").End(xlUp).Row
For Each Rng In Range("c101:C" & LstRw)
If Rng.Value = ComboBox3.Text Then
With UserForm1
.OutPutLabel3.Caption = Rng.Value
.TextBox1.Value = Rng.Offset(0, 1).Text
.TextBox2.Value = Rng.Offset(, 2).Text
.TextBox3.Value = Rng.Offset(, 3).Text
.TextBox4.Value = Rng.Offset(, 4).Text
.TextBox5.Value = Rng.Offset(, 5).Text
.TextBox6.Value = Rng.Offset(, 6).Text
End With
End If
Next Rng
UserForm1.Show
End Sub