Since it's returning a 0, I think I'd check the data one more time. Maybe that
date appears early in the table, but on a hidden row?
(E-Mail Removed) wrote:
>
> 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)
--
Dave Peterson