Public Function Coalesce(ParamArray x() As Variant) As Variant Dim i As Long Dim iMin As Long Dim iMax As Long Dim result As Variant iMin = LBound(x) iMax = UBound(x) result = Null For i = iMin To iMax If Not IsNull(x(i)) Then result = x(i) Exit For End If Next Coalesce = result End Function