Originally Posted by xld
Try this
[vba]
Const ws As String = "'C:\[Query 4.xlsx]Complex Query 4'!"
Const wsE As String = ws & "$E$2:$E$1008"
Const wsAB As String = ws & "$AB$2:$AB$1008"
Dim tmp As Variant
Dim res As Variant
With Worksheets("Project Allocation Sheet")
tmp = Replace(Replace( _
Left$(.Range("J6").Value, InStr(.Range("J6").Value & " ", " ") - 1), _
Left$(.Range("J6").Value, 2), ""), _
"-", " ")
tmp = Left$(.Range("J6").Value, 2) & _
Format(Left$(tmp, 10), "000") & "-" & _
Format(Right$(tmp, 10), "000")
End With
res = Application.Evaluate("IFERROR(INDEX(" & wsAB & "," & _
"MATCH($B8&" & tmp & "," & wsE & "&" & wsAB & ",0)),"""")")
[/vba]