Function dlookup(x, sr, tr, nr)
nm = WorksheetFunction.CountIf(nr, x)
If nm = 0 Then dlookup = tr.Cells(WorksheetFunction.Match(x, sr, 0), 1): Exit Function
nx = 0
For i = 1 To sr.Rows.Count
If sr.Cells(i, 1) = x Then nx = nx + 1
If nx = nm + 1 Then Exit For
Next i
If nx = nm + 1 Then dlookup = tr.Cells(i, 1): Exit Function
End Function
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Location of files for Quick Access Toolbar (QAT) settings in Office 2010 | 3 | 38 | |
MS excel check if Links exist | 5 | 36 | |
how to transpose my example data using VBA | 9 | 35 | |
sumifs excel 2013 | 3 | 16 |
Join the community of 500,000 technology professionals and ask your questions.