Got a weird one for you, hopefully it's something obvious.
I've got a table that consists of 3 columns; Batch Number, Job Number, Date of manufacture
I have one textbox for each; textbox1, textbox2, textbox3.
I want to type in the Batch number in Textbox1, then use vlookup to return the Job Number and Date of manufacture.
I have written the following code to do this:
However, it is not looking up the job number and date based on the batch number i enter UNLESS it has a letter in it.
For example, it wont recognise 10590, but it will recognise it if i changed it to C10590, then will display the job number and date.
Hope this makes sense!
I've got a table that consists of 3 columns; Batch Number, Job Number, Date of manufacture
I have one textbox for each; textbox1, textbox2, textbox3.
I want to type in the Batch number in Textbox1, then use vlookup to return the Job Number and Date of manufacture.
I have written the following code to do this:
VBA Code:
Private Sub TextBox9_AfterUpdate()
Dim MyTableArray As Range
Set MyTableArray = Sheets("Sheet2").Range("A:F")
On Error GoTo err_trap
Me.TextBox10.Value = WorksheetFunction.VLookup(Me.TextBox9, MyTableArray, 4, 0)
Me.TextBox11.Value = WorksheetFunction.VLookup(Me.TextBox9, MyTableArray, 5, 0)
err_trap:
Exit Sub
However, it is not looking up the job number and date based on the batch number i enter UNLESS it has a letter in it.
For example, it wont recognise 10590, but it will recognise it if i changed it to C10590, then will display the job number and date.
Hope this makes sense!