Hi,
I'm trying to use the Match function to take a specific date and find it within a row of cells. However, dates are giving me problems as the match function seems to be functioning poorly.
date_col_index returns 'Error 2042'
My dates are in the format of mmm-yy.
I was thinking about casting my date as a long, but the lookup_range would still be in normal date format. Any ideas around this?
I'm trying to use the Match function to take a specific date and find it within a row of cells. However, dates are giving me problems as the match function seems to be functioning poorly.
Code:
...
Sheets("Sheet1").Select
date = Cells(row_index, 5).Text
lookup_range = Sheets("Sheet2").Range("2:2")
date_col_index = Application.Match(date, lookup_range, 0)
...
date_col_index returns 'Error 2042'
My dates are in the format of mmm-yy.
I was thinking about casting my date as a long, but the lookup_range would still be in normal date format. Any ideas around this?