View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Dana DeLouis Dana DeLouis is offline
external usenet poster
 
Posts: 947
Default indeterminate 0/0

"divide by zero" error. I need a way to override this error but need
0/0 to equal 1


Hi. Just for discussion, 0/0 is an "Overflow" error.

Sub Demo()
Dim Ans
On Error Resume Next

'// 6 Overflow
Ans = 0 / 0
Debug.Print Err.Number; Err.Description

'// 11 Division by zero
Ans = 2 / 0
Debug.Print Err.Number; Err.Description

'// Maybe...
If Err.Number = 6 Then Ans = 1
Err.Clear
On Error GoTo 0
End Sub

(But you are correct, certain math programs treat 0/0 as Indeterminate vs
Excel's Overflow)
--
HTH. :)
Dana DeLouis
Windows XP, Office 2003


"integreat" wrote
in message ...

Is there a way to force VBA to do a division by zero without giving the
"divide by zero" error. I need a way to overrride this error but need
0/0 to equal 1


--
integreat
------------------------------------------------------------------------
integreat's Profile:
http://www.excelforum.com/member.php...o&userid=34282
View this thread: http://www.excelforum.com/showthread...hreadid=566460