在单个单元格中获取多个查找值。该单元格由多个名称组成,并用逗号分隔。
我尝试过alt F11,但我不太了解。
Public Function GymLookup(ByVal stringToProcess As String) As Variant
Application.Volatile
Dim var As Variant
Dim arrData As Variant
Dim strConcat As String
If InStr(1, stringToProcess, ",") > 0 Then
arrData = Split(stringToProcess, ",")
For Each var In arrData
'multiple handler
If strConcat = "" Then
strConcat = "enter your vlookup to resolve a result here"
Else
strConcat = strConcat & ", " & "enter your vlookup to resolve a result here"
End If
Next var
GymLookup = strConcat
Else
'Single cell lookup
GymLookup = "enter your vlookup to resolve a result here"
End If
End Function
无法保存在无宏的工作簿中