hello
i using a userform to search data and edit them
i using a combobx1 to search the data and then click the button to find the result
now i want when i type in combobox or select item from combobox then i show the result. i mean don't want to use the command button
thanx
code is here
and the sample is here![]()
Private Sub CommandButton1_Click() For Each C In Sheet4.Range("C61:C500").Cells If C.Value <> "" Then If ComboBox1.Value = C.Value Then TextBox1.Value = C.Offset(0, 0).Value TextBox2.Value = C.Offset(0, -2).Value TextBox3.Value = C.Offset(0, 1).Value TextBox4.Value = C.Offset(0, 2).Value TextBox5.Value = C.Offset(0, 3).Value TextBox6.Value = C.Offset(0, 4).Value MsgBox "Now you can edit." Else End If Else Exit Sub End If Next End Sub Private Sub CommandButton2_Click() For Each C In Sheet4.Range("C61:C500").Cells If C.Value <> "" Then If ComboBox1.Value = C.Value Then C.Offset(0, 0).Value = TextBox1.Value C.Offset(0, -2).Value = TextBox2.Value C.Offset(0, 1).Value = TextBox3.Value C.Offset(0, 2).Value = TextBox4.Value C.Offset(0, 3).Value = TextBox5.Value C.Offset(0, 4).Value = TextBox6.Value TextBox1.Value = "" TextBox2.Value = "" TextBox3.Value = "" TextBox4.Value = "" TextBox5.Value = "" TextBox6.Value = "" ComboBox1.Value = "" MsgBox "successful edited." Exit Sub Else End If Else Exit Sub End If Next End Sub











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks