public sub myUDF()
With Sheets("mySheet")
.Range("A2:A50").Formula = "=[COLOR=#333333]INDEX(TOTAL_WAGES,MATCH($F12,Resource_Code_LIST,0),MATCH(INDEX(WAGE_DECISION_DESC_LIST,MATCH(WAGE,WAGE_TYPE,0)),WAGE_NAM E,0)))"[/COLOR]
End With
End sub
Function SpecialLookUp(rng1 As Range, val1 As Variant, rng2 As Range, rng3 As Range, val2 As Variant, rng4 As Range, rng5 As Range)
SpecialLookUp = WorksheetFunction.Index(rng1, WorksheetFunction.Match(val1, rng2, 0), WorksheetFunction.Match(WorksheetFunction.Index(rng3, WorksheetFunction.Match(val2, rng4, 0)), rng5, 0))
End Function
Function SpecialLookUp(rng1 As Range, val1 As Variant, rng2 As Range, rng3 As Range, val2 As Variant, rng4 As Range, rng5 As Range)
SpecialLookUp = 0
On Error GoTo End1
SpecialLookUp = WorksheetFunction.Index(rng1, WorksheetFunction.Match(val1, rng2, 0), WorksheetFunction.Match(WorksheetFunction.Index(rng3, WorksheetFunction.Match(val2, rng4, 0)), rng5, 0))
End1:
End Function