View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] rwertheimer@gmail.com is offline
external usenet poster
 
Posts: 1
Default application.vlookup syntax

Hello,

I'm having trouble with the following piece of code -- it returns "0"
as startprice when it should not. I'm pretty sure the vlookup is not
working properly.

Any help is appreciated.

thanks,
rob

Function returnclose(numdays As Integer) As Long
' calculates return over period indicated by date entered and days in
left hand column
Dim startdate As Date
Dim startprice As Long
Dim enddate As Date
Dim endprice As Long

startdate = Range("startdate").Value
startprice = Application.VLookup(startdate, Range("OPWV_prices"),
2, False)