jayjay3489
New Member
- Joined
- Jul 13, 2015
- Messages
- 4
Hey
Ive came up stuck. I have a table of answers on "Input" sheet which have the same value im looking up but i need in my labels to show different answers in each.
for example my table is
78214 09/06/2015 MABEY HIRE LIMITED TRANSPORT/DELIVERY CHARGE INCL
78214 09/06/2015 MABEY HIRE LIMITED EMV-300 KIT MOUNTED VIBRATOR T
78214 09/06/2015 MABEY HIRE LIMITED TRANSPORT/COLLECTION CHARGE
78214 09/06/2015 MABEY HIRE LIMITED PLEASE ADHERE TO SITE DELIVERY
78201 09/06/2015 CHS NETWORKS LIMITED ADSL/SITE SET UP (£TBA)
78199 09/06/2015 ZEN INTERNET LIMITED PHONE LINE INSTALLATION (£TBC
78199 09/06/2015 ZEN INTERNET LIMITED ZEN LITE 20GB
78199 09/06/2015 ZEN INTERNET LIMITED PHONE LINE MONTHLY RETNAL (£T
78174 09/06/2015 DAVRO - T/A DAVLAV DAL3475 24' X 9' CANTEEN UNIT
78174 09/06/2015 DAVRO - T/A DAVLAV DAL3435 20' X 9' DRYING ROOM
and my code is
If Len(tboorder.Text) = 5 Then
On Error Resume Next
x = Application.WorksheetFunction. _
VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
If Err.Number = 0 Then
Label3.Caption = x
Label4.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label5.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label6.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label7.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label8.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label9.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label10.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label11.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label12.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label13.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label14.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label15.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label16.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Else
Label3.Caption = "No such product found"
On Error Resume Next
End If
On Error GoTo 0
End If
End Sub
Can anyone help. PLEASEEEE
Ive came up stuck. I have a table of answers on "Input" sheet which have the same value im looking up but i need in my labels to show different answers in each.
for example my table is
78214 09/06/2015 MABEY HIRE LIMITED TRANSPORT/DELIVERY CHARGE INCL
78214 09/06/2015 MABEY HIRE LIMITED EMV-300 KIT MOUNTED VIBRATOR T
78214 09/06/2015 MABEY HIRE LIMITED TRANSPORT/COLLECTION CHARGE
78214 09/06/2015 MABEY HIRE LIMITED PLEASE ADHERE TO SITE DELIVERY
78201 09/06/2015 CHS NETWORKS LIMITED ADSL/SITE SET UP (£TBA)
78199 09/06/2015 ZEN INTERNET LIMITED PHONE LINE INSTALLATION (£TBC
78199 09/06/2015 ZEN INTERNET LIMITED ZEN LITE 20GB
78199 09/06/2015 ZEN INTERNET LIMITED PHONE LINE MONTHLY RETNAL (£T
78174 09/06/2015 DAVRO - T/A DAVLAV DAL3475 24' X 9' CANTEEN UNIT
78174 09/06/2015 DAVRO - T/A DAVLAV DAL3435 20' X 9' DRYING ROOM
and my code is
If Len(tboorder.Text) = 5 Then
On Error Resume Next
x = Application.WorksheetFunction. _
VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
If Err.Number = 0 Then
Label3.Caption = x
Label4.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label5.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label6.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label7.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label8.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label9.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label10.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label11.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label12.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label13.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label14.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label15.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Label16.Caption = Application.WorksheetFunction.VLookup(Val(tboorder.Text), Worksheets("Input").Range("A3:H200"), 4, False)
Else
Label3.Caption = "No such product found"
On Error Resume Next
End If
On Error GoTo 0
End If
End Sub
Can anyone help. PLEASEEEE
![confused.gif](/board/proxy.php?image=http%3A%2F%2Fwww.excelforum.com%2Fimages%2Fsmilies%2Fconfused.gif&hash=03369b8540556f74bef818ce29947fbe)