View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Hexman Hexman is offline
external usenet poster
 
Posts: 13
Default Change the interior color of a cell - Code Review

On Sat, 17 Dec 2005 08:27:13 -0700, JE McGimpsey
wrote:

No, the presence of Text is not causing your error. Application.Max and
.Min ignore text.

They will not ignore errors, so if you have errors, you should
trap/eliminate them.

What error is appearing "on the IIF line"?


In article ,
Hexman wrote:

Ah! Much more concise code. In trying the 1st one, an error appears
on the IIF line. The range does contain some non-numeric cells, so I
believe an individual cell test has to be made. I'm assuming the IIF
statement assumes all the cells in the range contains numerics. How
do you get around that if some cells are alpha?

I do like the compactness of your code and would rather use it than my
own.



Run-time error '13':

Type mismatch.


You're right! In the cell is an error showing "#DIV/0!", which is an
error from one of his previous calculations on another sheet.

When I remove (zero out) the division errors everything works fine.

I know the real solution is to revise the original calculation to
eliminate the error.

Thanks for pointing this out. Again, excellent job of condensing and
streamlining the code.

Hexman