Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following loop is part of a larger macro.
For ILoop = NumRowsF850 To 1 Step -1 If Cells(ILoop, 5) = 0 Then Rows(ILoop).Delete End If Next ILoop If I find a null cell in the loop on line two, it is evaluated as 0 and the code branches to the third line. I do not want to execute the third line of code if the cell is null. How do I need to re-code line two to avoid this problem? TIA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try adding a check for isempty:
For iloop = numrowsf850 To 1 Step -1 If Cells(iloop, 5) = 0 And Not IsEmpty(Cells(iloop, 5)) Then Rows(iloop).Delete End If Next iloop Regards, Phil Webb "Ken" wrote in message ... The following loop is part of a larger macro. For ILoop = NumRowsF850 To 1 Step -1 If Cells(ILoop, 5) = 0 Then Rows(ILoop).Delete End If Next ILoop If I find a null cell in the loop on line two, it is evaluated as 0 and the code branches to the third line. I do not want to execute the third line of code if the cell is null. How do I need to re-code line two to avoid this problem? TIA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need a Error Handling for this Macro | Excel Discussion (Misc queries) | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
Error handling in macro | Excel Discussion (Misc queries) | |||
cell value based on null/not null in another cell | Excel Worksheet Functions | |||
Handling Null Field in Macro Loop | Excel Programming |