View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
DogLover DogLover is offline
external usenet poster
 
Posts: 37
Default VLOOKUP not working in VBA


These changes worked! Thank you both!!

"DogLover" wrote:

I am trying to perform at lookup in a defined range name=DemoEndDate.
Res comes back as blank. Is this the correct format?? Also, does anyone
know if this is the correct date format?

YY = Year(Worksheets("RFJ").Range("N8"))
MM = Month(Worksheets("RFJ").Range("N8"))
SDate = DateSerial(YY, MM, 1)

Dim YY As String
Dim MM As String
Dim SDate As Date

Res = Application.WorksheetFunction.VLookup(SDate, Range("DemoOEndDate"), 2,
False)