Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,661
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code:
It acquires the value of mcval from a cell in column J (Ji). It checks to see if it's numeric and simply reacts to whether it is or isn't. Normally, column J will either hold dates (numbers), or be empty.
When I run this code, mcval = 0 for empty cells, and thus is numeric. This isn't wrong of course, but I'm trying to identify the empty cells. I suspect it might have something to do with having declared mcval as long.
What must I change to ensure that the value for mcval on empty cells is null vs zero?
VBA Code:
. . .
For i = 2 To lstrow
mcval = .Range("J" & i)
If IsNumeric(mcval) Then
.Range("W" & i) = "YES"
Else
.Range("W" & i) = "NO"
End If
Next i
. . .
It acquires the value of mcval from a cell in column J (Ji). It checks to see if it's numeric and simply reacts to whether it is or isn't. Normally, column J will either hold dates (numbers), or be empty.
When I run this code, mcval = 0 for empty cells, and thus is numeric. This isn't wrong of course, but I'm trying to identify the empty cells. I suspect it might have something to do with having declared mcval as long.
What must I change to ensure that the value for mcval on empty cells is null vs zero?