From your code, I'm assuming the matrix will be filled completely, so ROWa is a valid limit on number of rows to search.

If the size you search for can be in any position in a row, the best you're going to be able to do is return the row's index in which it's found. If it is in a specific column of any row, that's all you'd need.