ISNULL( ) or something else...
I am having trouble making my macro run properly. The problem is happening
around the area with "!!!"
Public Sub assign()
Worksheets("Sheet3").Activate
Dim xnode As Long
Dim zrow As Long
zrow = 2
xnode = 1
Do While Range("B" & zrow).Value < 0
Range("A" & zrow).Value = xnode
xnode = xnode + 1
If Range("E" & zrow).Value < 0 Then
Range("D" & zrow).Value = xnode
xnode = xnode + 1
End If
' !!!
If Range("I" & zrow).Value < 0 Then
Range("H" & zrow).Value = xnode
xnode = xnode + 1
End If
' !!!
zrow = zrow + 1
Loop
End Sub
I am wanting it to put variable xnode into column H at row zrow. However, I
only want it to do this IF the cell in column I row zrow is not empty.
The result is that a value is put into H regardless of whether I has any
values in it or not.
Please help. Thanks.
|