Test for empty string

Using the VBA Len function to test for empty string values will improve the performance of your applications.


Dim strValue as String

'
' Typical method to test for empty string
'
If strValue = "" Then
MsgBox "String is empty"
End If

'
' Quicker method to test for empty string
'
If Len(strValue) = 0 Then
MsgBox "String is empty"
End If

EnvisionCAD

Since 1996, EnvisionCAD has been a nationally recognized leader in the configuration, customization, implementation, training & support for CAD software solutions. Our individualized approach has benefited private engineering firms and government agencies alike. Basic or advanced, we can help you get the most from your CAD technology.

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *