Hi there,
Can someone tell me why this code does not run. I'm new to excel and just playing around with some basic functions
Sub GetPrice()
Dim PartName As Variant
Dim Price As Double
PartNum = InputBox("Enter the Part Number")
Price = WorksheetFunction.VLookup(PartNum, Range("B2:C5"), 2, False)
MsgBox PartNum & "Cost" & Price
End Sub
The table is very basic and I've added it below.
<TBODY>
</TBODY><COLGROUP><COL span=2></COLGROUP>
<TBODY>
</TBODY><COLGROUP><COL span=2></COLGROUP>
Can someone tell me why this code does not run. I'm new to excel and just playing around with some basic functions
Sub GetPrice()
Dim PartName As Variant
Dim Price As Double
PartNum = InputBox("Enter the Part Number")
Price = WorksheetFunction.VLookup(PartNum, Range("B2:C5"), 2, False)
MsgBox PartNum & "Cost" & Price
End Sub
The table is very basic and I've added it below.
PartName | Price |
1 | $23.00 |
2 | $45.00 |
3 | $67.00 |
<TBODY>
</TBODY><COLGROUP><COL span=2></COLGROUP>
Thanks! | |
<TBODY>
</TBODY><COLGROUP><COL span=2></COLGROUP>