IS NULL

S

SIN

HI,
the if statement not execute .

the code:
v_checkvalue = xlRng.Value

If IsNull(v_checkvalue) = true Then
MsgBox "null" & v_row & ""
GoTo nextrow
End If

even when the value is null this code not working.

thanks.
 
D

Daniel

Are you sure your value is null?

There is difference between Null and "".

Perhaps this would work in your case
v_checkvalue = xlRng.Value

If IsNull(v_checkvalue) = true or v_checkvalue="" Then
MsgBox "null" & v_row & ""
GoTo nextrow
End If
 
D

Dirk Goldgar

In
SIN said:
HI,
the if statement not execute .

the code:
v_checkvalue = xlRng.Value

If IsNull(v_checkvalue) = true Then
MsgBox "null" & v_row & ""
GoTo nextrow
End If

even when the value is null this code not working.

Is v_checkvalue a Variant? If it is, and the MsgBox statement isn't
executed even when you *think* the value is Null, then I suspect the
value isn't really Null. There are other possible "blank" values that
aren't Null. Maybe it's a zero-length string, or even Empty, instead.

Set a breakpoint in the code, at the If statement. When it stops there,
let your mouse pointer hover over v_checkvalue, and see if the tooltip
tells you that the value is something other than Null.
 
Top