Attribute VB_Name = "udf_firstValue" '------------------------------------------------------------------------------- 'File : udf_firstValue.bas ' Copyright mpl by ERB software ' All rights reserved ' http://wiki.yaslaw.info/dokuwiki/doku.php/vba/functions/firstValue 'Environment : VBA 2010 + 'Version : 1.0.0 'Name : strSplit 'Author : Stefan Erb (ERS) ''------------------------------------------------------------------------------- Option Explicit '/** ' * gibt den ersten Eintrag der nicht NULL ist zurück. ' * Ist sehr gut geeignet um aus Queries zuzugreiffen ' * Die Funktion funktioniert auch mit Objekten ' * @return Variant ' * @example: ' * ?firstValue(null, null,13,14, null) //Rückgabewert 13 ' */ Public Function firstValue(ParamArray items() As Variant) As Variant For Each firstValue In items If Not IsNull(firstValue) Then Exit For Next End Function