G
Guest
If I match a named range ("Criteria_12") I get the correct result but if I
assign the cell value to a variable I get an #N/A error. It makes no
difference if I declare (DIM) the variables dt or curr_date.
Why?
TIA
dt = Range("Criteria_12")
curr_date = DateSerial(Year(dt), Month(dt), Day(dt))
' This works OK .......
Range("A5") = Application.Match(Range("Criteria_12"), Range("1:1"), 0)
' These return error conditions ....WHY?
Range("A6") = Application.Match(dt, Range("1:1"), 0)
Range("A7") = Application.Match(curr_date, Range("1:1"), 0)
assign the cell value to a variable I get an #N/A error. It makes no
difference if I declare (DIM) the variables dt or curr_date.
Why?
TIA
dt = Range("Criteria_12")
curr_date = DateSerial(Year(dt), Month(dt), Day(dt))
' This works OK .......
Range("A5") = Application.Match(Range("Criteria_12"), Range("1:1"), 0)
' These return error conditions ....WHY?
Range("A6") = Application.Match(dt, Range("1:1"), 0)
Range("A7") = Application.Match(curr_date, Range("1:1"), 0)