Gruppe
UDF
Problem
Die benutzerdefinierte Funktion in Zelle E2 soll die SVERWEIS-Formel so nachbilden, dass leere Zellen in Spalte B keine Berücksichtigung finden.
StandardModule: Modul1
Function NoEmptysVL(vSearch As Variant, rngSearch As Range, iCol As Integer) As Variant
Dim iRow As Integer
For iRow = 1 To rngSearch.Rows.Count
If rngSearch.Cells(iRow, 1).Value = vSearch And Not IsEmpty(rngSearch.Cells(iRow, iCol)) Then
NoEmptysVL = rngSearch.Cells(iRow, iCol).Value
Exit Function
End If
Next iRow
NoEmptysVL = "#NV"
End Function