PC Review


Reply
Thread Tools Rate Thread

application.vlookup syntax

 
 
rwertheimer@gmail.com
Guest
Posts: n/a
 
      30th Nov 2006
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)

 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      30th Nov 2006
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
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
vlookup from two sources - syntax of vlookup statement Roger on Excel Microsoft Excel Programming 2 14th Dec 2009 07:41 PM
Re: Vlookup syntax Gary Keramidas Microsoft Excel Programming 0 14th Sep 2005 04:35 PM
Re: Vlookup syntax Michael Smith Microsoft Excel Programming 0 14th Sep 2005 04:27 PM
VLOOKUP syntax JC Microsoft Excel Misc 2 15th Jan 2004 02:09 AM
VLOOKUP syntax ? Alien Microsoft Excel Misc 3 14th Aug 2003 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:14 PM.