polarisking
Member
The following seven date values are contained in Column A rows 1 through 7
7/25/2016
7/26/2016
7/27/2016
7/28/2016
7/29/2016
7/30/2016
7/31/2016
I'm getting stuck using MATCH within VBA using Date lookups. Keeps coming back with a 1004 - not found message. Change the values to animal names and the match argument to one of the names, and it works fine. I must not be handling the date properly, but I cannot figure out what the problem is.
7/25/2016
7/26/2016
7/27/2016
7/28/2016
7/29/2016
7/30/2016
7/31/2016
I'm getting stuck using MATCH within VBA using Date lookups. Keeps coming back with a 1004 - not found message. Change the values to animal names and the match argument to one of the names, and it works fine. I must not be handling the date properly, but I cannot figure out what the problem is.
Code:
Sub Chandoo()
Debug.Print WorksheetFunction.Match(CDate("7/28/2016"), Range("A1:A7"), 0)
End Sub