```
Option Explicit
Sub GetPriceNum_Text()
'Written by Trebor76
'Visit my website www.excelguru.net.au
'Dim AMT As Long
Dim varPartNum As Variant
Dim varPartQty As Long
varPartNum = InputBox("Enter the Part Number")
varPartQty = InputBox("How many of this Part Number")
Range("I100").End(xlUp).Offset(1, 0) = varPartNum
Range("J100").End(xlUp).Offset(1, 0) = varPartQty
If varPartNum = "" Then Exit Sub 'User clicked the Cancel button
If IsNumeric(varPartNum) Then
If IsError(Evaluate("VLOOKUP(" & varPartNum & ",B2:C10,2,FALSE)")) = True Then
MsgBox "There is no entry for part number " & varPartNum
Else
MsgBox "The cost for part number " & varPartNum & " is " _
& Format(Evaluate("VLOOKUP(" & varPartNum & ",B2:C10,2,FALSE)"), "$#,##0.00")
Range("K100").End(xlUp).Offset(1, 0) = Format(Evaluate("VLOOKUP(" & varPartNum _
& ",B2:C10,2,FALSE)"), "$#,##0.00")
End If
Else
If IsError(Evaluate("VLOOKUP(""" & varPartNum & """,B2:C10,2,FALSE)")) = True Then
MsgBox "There is no entry for part number " & varPartNum
Else
MsgBox "The cost for part number " & varPartNum & " is " _
& Format(Evaluate("VLOOKUP(""" & varPartNum & """,B2:C10,2,FALSE)"), "$#,##0.00")
Range("K100").End(xlUp).Offset(1, 0) = Format(Evaluate("VLOOKUP(""" & varPartNum _
& """,B2:C10,2,FALSE)"), "$#,##0.00")
End If
End If
End Sub
```