Solved

Identify rows that have generated errors through their calculations

Posted on 2003-12-04
2
221 Views
Last Modified: 2010-04-17


I have columns B through IV, rows 4 -45

all of the results for these fields are generated through calculations.  Some experience errors and result in #Value! or #DIV/0!  I don't want to change the numbers being generated and know why those errors occur.  But I would like to run a macro that woudl go through all the rows and evrytime it runs into one that generated an error change it to blank, without it removing the calculation that still sits in the cell - is this possible?
0
Comment
Question by:Mosquitoe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Expert Comment

by:KurtVon
ID: 9877832
I'm assuming you are using Excel.

If so, just change the formulas to use error checking:

=if(ISERR(originalformula), "", originalformula)

I suppose you could write a macro to change that.  I know of no other way to "blank" a cell and leave the formula intact at the same time.

Hoep this helps.
0
 
LVL 50

Accepted Solution

by:
Dave Brett earned 50 total points
ID: 9879968
Hi Mosquitoe,

If you run this maco it will convert all error cells in the activesheet to blanks without removing the formula

I suggest saving yur work before running this

Cheers

Dave

Sub MakeErroBlank()
Dim myrange    As Range
Dim cel        As Range
Dim cf As String
    On Error Resume Next
    Set myrange = ActiveSheet.Cells.SpecialCells(xlCellTypeFormulas, xlErrors)
    On Error GoTo 0
    If myrange Is Nothing Then Exit Sub
    For Each cel In myrange
        cf = Right(cel.Formula, Len(cel.Formula) - 1)
        cel.FormulaR1C1 = "=IF(ISERROR(" & cf & "),""""," & cf & ")"
    Next
End Sub

Cheers

Dave
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Hide vba in gp 7 115
C# Error - Add Failed 12 99
Identify two keyboard codes and how to enter them 9 69
maven disable workspace resolution 1 38
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question