Thread: Catching errors
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
cbh35711[_10_] cbh35711[_10_] is offline
external usenet poster
 
Posts: 1
Default Catching errors


So i've filled a column with "=G2*VLOOKUP(D2,Units,2,FALSE)"
Sometimes that's going to fail and the value of the cell will be
#VALUE!.
So then i've got a loop to go through and clear any 0s. However, the
problem occurs when it hits one of the cells that didn't calcuate
right. I want to clear that cell's value, but i wasn't sure how to
catch it.

Do While Not IsEmpty(ActiveCell.Offset(0))

If ActiveCell.Value = 0 Then
ActiveCell.Value = ""
Else: ActiveCell.Value = 1
End If

ActiveCell.Offset(1).Select
Loop


Thanks,

Chris


--
cbh35711
------------------------------------------------------------------------
cbh35711's Profile: http://www.excelforum.com/member.php...o&userid=30276
View this thread: http://www.excelforum.com/showthread...hreadid=529383