View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Niek Otten Niek Otten is offline
external usenet poster
 
Posts: 3,440
Default Vlookup Cannot Find a Particular Date in a Range?

Use Range instead of Columns

Price=Application.WorksheetFunction.Vlookup(EntyDa te,Sheets("Price").Range("A:B"),2,0)

But if a date is not there, it will look through the entire column. So it is better to limit the range to the rows that actually
contain data.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"CCL" wrote in message ...
| When I use a Vlookup function in VBA to search the record entry dates from a
| range, it cannot find the record and just returns the run-time error. I am
| sure that the particular dates exist in the range since I have used Countif
| in VBA and Vlookup in worksheet to test if it exists. Could anybody tell me
| why?
|
| Price=Application.WorksheetFunction.Vlookup(EntyDa te,Sheets("Price").Columns("A:B"),2,0)
|
| Thanks
|