RAJAQ
11/25/2016 - 5:23 PM

VLookUp a value; in a specified range; in a specified sheet change the parameters as required

VLookUp a value; in a specified range; in a specified sheet change the parameters as required

Option Explicit

Sub GetPrice()
Dim ProductName As Variant
Dim Price As Double

ProductName = InputBox("Enter the Director name")
Sheets("Sheet1").Activate
Price = WorksheetFunction.VLookup(ProductName, Range("A1:B6"), 2, False)
MsgBox Price

End Sub