View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Use "VLookup" function

dim target as Range
Dim lookRange as Range
Dim res as Variant

Set target = Range("A1")
Set lookRange = worksheets("Sheet2").Range("A1:F300")

res = Application.Vlookup(Target,lookRange,2,False)
if iserror(res) then
' not found
else
msgbox "Result is " & res
End if


--
Regards,
Tom Ogilvy


"Grey" wrote in message
...
i want to know that how to use "VLookup" function in VBA?