[Dba-office] Direct replacement for Nz in Word/Excel
gustav at cactus.dk
Thu Dec 10 07:47:24 CST 2015
I had a need for this in Word, but couldn't find a decent solution, so here is - should you encounter the same situation:
' Replacement for Microsoft Access' function Application.Nz().
' For use in Word/Excel to eliminate the need for a reference to:
' Microsoft Office 15.0 Access database engine Object Library.
' 2015-12-10. Gustav Brock, Cactus Data ApS, CPH.
Public Function Nz( _
ByRef Value As Variant, _
Optional ByRef ValueIfNull As Variant = "") _
Dim ValueNz As Variant
If Not IsEmpty(Value) Then
If IsNull(Value) Then
ValueNz = ValueIfNull
ValueNz = Value
Nz = ValueNz
More information about the Dba-office