Hi Trying to do a simple lookup but not getting any results
I have a combo box (cb1) and when i click on edit it should return the 4th column (Customer Name )value in to textbox1(tb1) on the form
Data is name of range a1:i4
it go to error 1004 debug
any ideas would be a help
thanks
in advance
Private Sub CommandButton1_Click()
If WorksheetFunction.CountIf(Sheet10.Range("b:b"), Me.CB1.Value) = 0 Then
MsgBox "No details to retrive"
End If
If Application.WorksheetFunction.CountIf(Worksheets("Database").Range("b:b"), Me.CB1.Value) = 1 Then
With Me
MsgBox "YES IT 1"
.TB1 = Application.WorksheetFunction.VLookup(CLng(Me.CB1), Sheet10.Range("Data"), 4, False)
End With
End If
End Sub
I have a combo box (cb1) and when i click on edit it should return the 4th column (Customer Name )value in to textbox1(tb1) on the form
Data is name of range a1:i4
it go to error 1004 debug
any ideas would be a help
thanks
in advance
Private Sub CommandButton1_Click()
If WorksheetFunction.CountIf(Sheet10.Range("b:b"), Me.CB1.Value) = 0 Then
MsgBox "No details to retrive"
End If
If Application.WorksheetFunction.CountIf(Worksheets("Database").Range("b:b"), Me.CB1.Value) = 1 Then
With Me
MsgBox "YES IT 1"
.TB1 = Application.WorksheetFunction.VLookup(CLng(Me.CB1), Sheet10.Range("Data"), 4, False)
End With
End If
End Sub
Date | Serial No | Instrument | Customer Name | Customer Address | Order No | Tag No | Model No | Serial No |
10159 | it worked | noreen | ||||||
15/Feb/22 | 10160 | patsy | ||||||
15/Feb/22 | 10161 | PRESSURE INDICATOR | john | carrig | 234rf | pi1452 | pi789 | 4856 |