Dim barcode As Variant
Dim name As Variant
Dim stock As Variant
Dim barcode2 As Double 'error with this one
barcode = InputBox("Barcode Of Item?")
If barcode = "" Then
Exit Sub
Else
ThisWorkbook.Sheets("Money In").Range("c1").Value = barcode
If IsNumeric(barcode) Then
barcode2 = ThisWorkbook.Sheets("Money In").Range("c1").Value
ThisWorkbook.Sheets("Money In").Range("c1").Value = ""
name = Application.VLookup(barcode2, Worksheets("Item").Range("A2:H15000"), 4)
'MsgBox (barcode2)
If IsError(name) Then
MsgBox ("Sorry barcode not found, Please try again")
Else
TextBox1.Text = name
stock = Application.VLookup(barcode2, Worksheets("Item").Range("A2:H15000"), 6)
If IsError(stock) Then
Exit Sub
Else
TextBox2.Text = stock
TextBox1.Visible = True
TextBox2.Visible = True
Label9.Visible = True
Label10.Visible = True
Label12.Visible = True
Label13.Visible = True
End If
End If
Else
MsgBox ("Please enter numbers only")
Exit Sub
End If
End If