I've tried using the following (simplified) code to look up a date in a named range and return the result from the same row in the next column to the right. I can do this easily in the worksheet, but I can't write a VBA function to do it.
Code:
Named range tab1:
date result
11/30/09 result 1
12/02/09 result 2
12/07/09 result 3
Cell D11:
=vlok()
As an alternative, I've looked into using the Find method, but I need VLookup's ability to return a result from the prior row if it doesn't find an exact match. The example above should find an exact match because the lookup date is written into the code. If I can get this simplified code to work, I will send the lookup date to the function. That date might not be in the lookup table.
Thanks for any help.
Bookmarks