mahmed1
Well-known Member
- Joined
- Mar 28, 2009
- Messages
- 2,302
- Office Version
- 365
- 2016
- Platform
- Windows
Hi all
I have been having issues with my match function if there isnt a match found. I had initially had worksheetfunction.match but read that i need to change to application.match but im still getting a type mismatch error - where am i going wrong?
I have been having issues with my match function if there isnt a match found. I had initially had worksheetfunction.match but read that i need to change to application.match but im still getting a type mismatch error - where am i going wrong?
Code:
MatchHeaders = Application.Match(QuestionRange.Cells(rr, cc).Value, ws.Range(ws.Cells(2, 1), ws.Cells(2, Lcol)), 0)
If IsError(MatchHeaders) Then
Outputsh.Cells(OutputLR, 12).Value = 1
Outputsh.Cells(OutputLR, 15).Value = "Question not found"
Elseif not isnumber(ws.Cells(i, MatchHeaders))
Outputsh.Cells(OutputLR, 12).Value = 1
Outputsh.Cells(OutputLR, 15).Value = "Not a valid entry"
else
Outputsh.Cells(OutputLR, 12).Value = ws.Cells(i, MatchHeaders)
End If
Last edited: