View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Kevin Porter Kevin Porter is offline
external usenet poster
 
Posts: 38
Default Code for dealing with #REF

How would I use it when using variables. I am using RowToFind and ColToFind
earlier in the code. But when I try to replace (A1:A10) in the code with
those variables it does not recognize them, of course. I have been playing
with it since your response and not making much headway.

Thanks for your help.

"Jim Rech" wrote:

You can trap REFs or any kind of errors in cell values like this:

=IF(ISERROR(SUM(A1:A10)),0,SUM(A1:A10))

Excel 2007 has a shorter form:

=IFERROR(SUM(A1:A10),0)

You'd of course replace the 0 with another formula.


--
Jim
"Kevin Porter" wrote in message
...
|I have some fields that end up #REF because of deletes that are done. I
| would like to look at that field, if it contains #REF then I want that
field
| to be the sum of all the columns in that row. If it doesn't then I want
it
| to equal what it equals.
|
| Thanks,
|
| Kevin Porter