View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Andy Pope Andy Pope is offline
external usenet poster
 
Posts: 2,489
Default DELETE CELLS w/ "DIV/0" MACRO

Hi,

If your formula are in the range C4:C10 then,

Sub ClearFormulaErrors()
On error resume next
range("C4:C10").SpecialCells(xlCellTypeFormulas,xl Errors).Clear
End Sub

Instead of "" use NA(). This will not create a gap but will stop if being
treated as zero.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Tim H" wrote in message
...
Trying to write a macro that will do a 'search and delete' type function
for
cells that yield a "DIV/0" error.

What I want to accomplish is a break in the line graph when there is no
data. Problem is that excel 2003 treats anything in a cell other than a
numerical value as a ZERO. Even if I write an IF(ISERROR) function to
yield
"", it still treats the cell as a zero value.

The only way to get a break in the line is to actually delete out the
formula completely when there's a "DIV/0" error.

Any suggestions?