Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2006

Tip: Looking for answers? Try searching our database.

Vlookup Cannot Find a Particular Date in a Range?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CCL - 11 Dec 2006 12:24 GMT
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(EntyDate,Sheets("Price").Columns("A:B"),2,0)

Thanks
Niek Otten - 11 Dec 2006 12:53 GMT
Use Range instead of Columns

Price=Application.WorksheetFunction.Vlookup(EntyDate,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.

Signature

Kind regards,

Niek Otten
Microsoft MVP - Excel

| 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
[quoted text clipped - 5 lines]
|
| Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.