I am getting the mentioned error when executing the following line of code:
Check_Row = Application.WorksheetFunction.Match(ActiveCell, Application.WorksheetFunction.Index(Selection, 0, 1), 0)
Both my ActiveCell and Selection seem to be correctly defined - ActiveCell contains some text, and the first Column of Selection contains a cell with the value match of ActiveCell. Also, when I try to run almost the same code (below) in a freshly opened excel sheet, it is working fine?
Sub Test()
Range("start").Select
Range(Selection, Selection.End(xlDown)).Select
Range(Selection, Selection.End(xlToRight)).Select
test_selection = Selection
Range("A8").Select
Check_Row = Application.WorksheetFunction.Match(ActiveCell,Application.WorksheetFunction.Index(test_selection, 0, 1), 0)
Range("A9").Value = Check_Row
End Sub
Does anyone have an idea what I might be overlooking here? What could be causing this issue?