I've been tearing my hair out for 2 days trying to figure out why I keep getting an Error 1004 (Unable to get the Match property of the WorksheetFunction class) with this code:
Here are the debug results from the Intermediate window:Please Login or Register to view this content.
EndDate - 6 = 3/24/2018
EndDate = 3/30/2018
SearchRange.Address = $C$305:$C$627
EndDate is a named range (with Date format) in ThisWorkbook (which is the active workbook). SearchRange is declared As Range and is set to a range in another (open) workbook, and all the cells in that range are in Date format. The address of SearchRange is correct, and it refers to the correct worksheet. DateStartRow is declared As Long.
If I go to the worksheet that includes SearchRange and enter the MATCH formula by hand [=MATCH(E9,$C$305:$C$627,1), where cell E9 contains the date 3/24/18], it works fine. But every time I run the macro, I get Error 1004. Help!!
Bookmarks