User login

Check For Null or Empty String

I found the following piece of code effective:

If str = vbNullString Then ...


If there is an error in a cell formula, like from a VLOOKUP the way around it is to use the IsError function:

If Not IsError(ActiveWorkSheet.Range("A1")) Then ...


Database Null

A related VB issue is to check for a null value coming from a database query. In this case, you need to use the IsDBNull function