Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home

#DIV/0!

Posted by JC on May 29, 2001 1:47 PM
Ive written a program that does various analysis.
In it some cells wind up being divided by zero.
THese cells get a screen value of (#DIV/0!).
There value in VBA read into a variable becomes for example (P = Error2700)
I am trying to write a comand to notice these as the program continues, and when the cell is called let it be equal to 0. But I cannot seem to write an if to recognize Error2700. What do I do?

Check out our Excel VBA Resources

Re: #DIV/0!

Posted by Jerid on May 29, 2001 2:04 PM

Hi JC.

Try this


Dim vTemp As Variant

vTemp = ActiveCell

If vTemp = CVErr(2007) Then
ActiveCell.Value = 0
End If

Jerid


Re: #DIV/0!

Posted by JC on May 29, 2001 2:26 PM
Thanks
WLAC!

This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.