KK1966
07-11-2008, 12:08 AM
hi
can u help to check with the code which I marking wrong as the code can't compliling,
The combobox I can't type a value ?
Private Sub cboName_Change()
Dim rng As Range
On Error GoTo hi
With Sheets("Sheet1")
Set rng = Range(.Cells(1, 1), .Cells(1, 1).End(xlDown)).Value
End With
With rng.Find(cboName.Value, lookat:=xlWhole)
Me.txtCode2.Text = .Cells(Me.cboName.ListIndex + 2, "B").Value
Me.txtAmount2.Text = .Cells(Me.cboName.ListIndex + 2, "C").Value
Exit Sub
hi:
MsgBox ("The words you may typed a wrong")
End With
End Sub
can u help to check with the code which I marking wrong as the code can't compliling,
The combobox I can't type a value ?
Private Sub cboName_Change()
Dim rng As Range
On Error GoTo hi
With Sheets("Sheet1")
Set rng = Range(.Cells(1, 1), .Cells(1, 1).End(xlDown)).Value
End With
With rng.Find(cboName.Value, lookat:=xlWhole)
Me.txtCode2.Text = .Cells(Me.cboName.ListIndex + 2, "B").Value
Me.txtAmount2.Text = .Cells(Me.cboName.ListIndex + 2, "C").Value
Exit Sub
hi:
MsgBox ("The words you may typed a wrong")
End With
End Sub