Heres what you need. Just add your other options to the code
![]()
Private Sub CommandButton1_Click() On Error GoTo oeps With Sheets(Left(Trim(TextBox1), 1)) r = Application.Match((Trim(TextBox1)), .Range("A:A"), 0) TextBox1 = .Range("A" & r) TextBox2 = .Range("B" & r) TextBox3 = .Range("C" & r) TextBox4 = .Range("D" & r) TextBox5 = .Range("E" & r) TextBox6 = .Range("F" & r) TextBox7 = .Range("G" & r) TextBox8 = .Range("I" & r) TextBox9 = .Range("K" & r) Select Case .Range("L" & r).Value Case Is = "T-shirt" Me.CheckBox1.Value = True Me.CheckBox2.Value = False Me.CheckBox3.Value = False Me.CheckBox4.Value = False Case Is = "T-shirt/Calendar/Others" Me.CheckBox1.Value = True Me.CheckBox2.Value = True Me.CheckBox3.Value = False Me.CheckBox4.Value = True End Select End With Exit Sub oeps: MsgBox "No match with" & Chr(13) & Chr(13) & "Company-ID " & TextBox1 End Sub
Bookmarks