I have a list of ascending dates. I am using the following formula to return the cell reference:
=CELL("address",INDEX(A2:A14,MATCH(D1,A2:A14,1)))
This formula gives me the result I what e.g. a search for 1/2/2017 returns the cell reference of $A$6. While a search for 12/30/2016 returns the cell reference of $A$4.
How would I accomplish the same result using VBA, while returning the next date value in the list if the search date is greater than the previous date in the list and another date that is greater than the search date exist?
Dates 1/2/2017
12/27/2016 $A$6
12/28/2016
12/29/2016
1/1/2017
1/2/2017
1/3/2017
...
Application.Match()
in a similar way to how you use MATCH() on a worksheet. LikewiseApplication.Index()
– Tim Williams