Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Test for null - insert a row if isnull | Excel Discussion (Misc queries) | |||
Curious IsNull test | Excel Programming | |||
problem using isnull() to check a value in ADODB.Recordset | Excel Programming | |||
ISNULL function - can't find it | Excel Worksheet Functions |