Thread: #DIV0!
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CV323 CV323 is offline
external usenet poster
 
Posts: 28
Default #DIV0!

When I use this code, I'd like to divide cells, sometimes it's dividing by 0s
which results in #DIV0!, how can i make this return a zero instead? Or am I
using the wrong code?


Range("D59").Select
ActiveCell.FormulaR1C1 = "=(R[-1]C/R[-1]C[1])"
If IsError(ActiveCell.Value) Then
errval = ActiveCell.Value
Select Case errval
Case CVErr(xlErrRef)
ActiveCell.Value = 0
Case Else
'



End Select
End If