[Dba-office] Direct replacement for Nz in Word/Excel
jbodin at sbor.com
Thu Dec 10 08:04:57 CST 2015
very handy gustav, thanks for sharing. I still remember when I found out about NZ() in Access - wondered how I ever got by without it and I certainly use it all the time now.
From: Dba-office <dba-office-bounces at databaseadvisors.com> on behalf of Gustav Brock <gustav at cactus.dk>
Sent: Thursday, December 10, 2015 8:47 AM
To: dba-office at databaseadvisors.com
Subject: [Dba-office] Direct replacement for Nz in Word/Excel
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
Dba-office mailing list
Dba-office at databaseadvisors.com
More information about the Dba-office