Thread: Date VBA Lookup
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
jlclyde jlclyde is offline
external usenet poster
 
Posts: 410
Default Date VBA Lookup

I am trying to use Vlookup as intended by excel and find the closest
match to today. In K coloumn I have dates that are sorted ascending.
In M I have the value I woudl liek to return. Neither of these work.
Any help woudl be appreciated. Code Below.

Thanks,
Jay

Set Fn = Application.WorksheetFunction
Qty = Fn.VLookup(DateSerial(Year(Date), Month(Date), Day(Date)), Range
("K2:M7"), 3)
Qty = Fn.VLookup(Date, Range("K2:M7"), 3)