Gruppe
UDF
Problem
Wie muß eine benutzerdefinierte Funktion aussehen, die eine SVERWEIS()-Suche über mehrere Bereiche durchführt?
StandardModule: basMain
Function SSVerweis( _
var As Variant, _
iCol As Integer, _
ParamArray rng())
Dim iCounter As Integer
For iCounter = 0 To UBound(rng)
If IsError(Application.VLookup(var, _
rng(iCounter), iCol, 0)) = False Then
SSVerweis = Application.VLookup(var, _
rng(iCounter), iCol, 0)
Exit Function
End If
Next iCounter
End Function