View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default ISNULL( ) or something else...

Just to add to the excellent suggestions

If the change is

If Range("I" & zrow).Text < "" Then

then it should work in xl97 as well although I can think of some other
drawbacks - but they should be rare

another would be

If Not IsEmpty(Range("I" & zrow)) then



--
Regards,
Tom Ogilvy

"Zack Barresse" wrote in message
...
Change this line ...

If Range("I" & zrow).Value < 0 Then

.. to this ...

If Range("I" & zrow).Value < "" Then

HTH

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"Shane" wrote in message
...
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.