formula error

  • Thread starter Thread starter marksuza
  • Start date Start date
M

marksuza

Hi, can anybody help me please. I have a bounce of formulas in a shee
that are showing #DIV/0!. I tried usin
=IF(((J32)/(K12*1000))*12=iserror, "-", ((J32)/(K12*1000))*12), to hid
them until the user inputs something to make them work. This is no
working though, I dont thing iserror is the right syntax. Can anybod
help. Thanks.

Marco
 
Hi, can anybody help me please. I have a bounce of formulas in a sheet
that are showing #DIV/0!. I tried using
=IF(((J32)/(K12*1000))*12=iserror, "-", ((J32)/(K12*1000))*12), to hide
them until the user inputs something to make them work. This is not
working though, I dont thing iserror is the right syntax. Can anybody
help. Thanks.

Marcos

If all you want to do is "hide" the error, you could use conditional
formatting:

1. Select the cells in which this problem may occur, e.g. A1:A100.
2. Format/Conditional Formatting
Formula Is: =ISERR(A1)
Format Font Color to White (or whatever your background color is).

The error will still be in the cell, but you won't see it.



--ron
 
Frank's suggestion is the preferred route to go. Trap for the error instead
of hiding the error message.

However, if you DO want to hide using ISERROR on a great whack of formulas,
you could use this macro which will return............

=IF(ISERROR((J32/(K12*1000))*12),"-",(J32/(K12*1000))*12)

Sub ErrorTrapAdd()
Dim myStr As String
Dim cel As Range
For Each cel In Selection
If cel.HasFormula = True Then
If Not cel.Formula Like "=IF(ISERROR*" Then
myStr = Right(cel.Formula, Len(cel.Formula) - 1)
cel.Value = "=IF(ISERROR(" & myStr & "),""-""," & myStr & ")"
End If
End If
Next
End Sub

Gord Dibben Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top