I see both of these threads:
http://www.mrexcel.com/forum/showthread.php?t=68318
http://www.mrexcel.com/forum/showthread.php?t=450418
but I can't get Application.Match to work with a date and a date array. CDate and CLng on the date, don't help (and can't be applied to the array). And my debugging code shows that the date variable is equal to the second value in the array:
In the locals window, x is type "Date(1 to 2)". And the value of y is "TRUE". So, yes, they match--they do! But all I get is Error 13, Type mismatch, on the iCol =, last line. (And I can't get WorksheetFunction.Match or Application.WorksheetFunction.Match to work at all (1004--can't get the property).
I guess I just have to use a Do loop, through the array. But it really should be a 1-line solution, and I successfully match doubles and strings in the same code...
http://www.mrexcel.com/forum/showthread.php?t=68318
http://www.mrexcel.com/forum/showthread.php?t=450418
but I can't get Application.Match to work with a date and a date array. CDate and CLng on the date, don't help (and can't be applied to the array). And my debugging code shows that the date variable is equal to the second value in the array:
Code:
Dim x() As Date
x = p_dtExpiryArray
Dim y As Boolean
y = (dtExpiry = p_dtExpiryArray(2))
iCol = Application.Match(dtExpiry, p_dtExpiryArray, 0)
I guess I just have to use a Do loop, through the array. But it really should be a 1-line solution, and I successfully match doubles and strings in the same code...