Try
Sub test()
Range("e2", Range("e" & Rows.Count).End(xlUp)).Offset(, 10).Formula = "=Koyish(e2,f2)"
End Sub
Function Koyish(r1, r2) As String
Dim myList
myList = Array("INL", "FDK", "FDP", "FG", "RMB")
If TypeName(r1) = "Range" Then r1 = r1.Value
If TypeName(r2) = "Range" Then r2 = r2.Value
Select Case r2
Case 700, 705, 707, 710, 720
If IsError(Application.Match(r1, myList, 0)) Then
Koyish = "ADV"
End If
Case 732, 734, 750
If IsError(Application.Match(r1, myList, 0)) Then
Koyish = "DOC"
End If
Case 103, 199, 202, 742
If IsError(Application.Match(r1, myList, 0)) Then
Koyish = "PAY"
End If
Case 740, 742, 747, 799
If r1 = "RMB" Then Koyish = "RMB"
End Select
End Function
Bookmarks