Solved

#Num and #Value

Posted on 2011-02-21
7
362 Views
Last Modified: 2012-06-27
I have many formulas that say this after deleting a cell that the formula is "looking at".  I think there is a way to replace those with something else?  

say for instance, would rather it say "No" or maybe there is something more appropriate that an expert would know.

thank you
0
Comment
Question by:pdvsa
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 34947503
You can use IFERROR function in Excel 2007, e.g.

=IFERROR(your_formula,"No")

or in earlier versions

=IF(ISERROR(your_formula),"No","your_formula)

you can replace "No" with "" to make the formula return a blank

regards, barry
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34947520
pdvsa,

Try this sort of syntax:

=IF(ISERROR(Your formula here),"There's an error because a value used in the formula has just been deleted", ),Your formula here)

Patrick
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34947523
Xover I'm afraid...
0
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!

 
LVL 81

Expert Comment

by:byundt
ID: 34947672
If the formulas have already been entered and the cells deleted, then you can replace all the resulting error values with your desired text by using the following steps:

1) Select a range of cells containing error values you want to replace
2) F5, and then click the Special Cells button at bottom of resulting dialog
3) Choose the option for Formulas, then untick all the options except Errors
4) Click OK. This will select just the cells where error values are returned by formulas.
5) Click in the formula bar and enter the desired text
6) Hold the Control button down, then hit Enter


Brad
0
 

Author Comment

by:pdvsa
ID: 34948280
Hi Brad, 1 qstn, would i have to do this only once, save the file and then each time i encounter the error, it would be handled?

Thank you
0
 
LVL 81

Expert Comment

by:byundt
ID: 34948386
Yes. You would need to perform the manual procedure each time you want to clear the errors.

You can automate the process with a macro, however.
'This sub should be installed in a regular module sheet. Ideally, it would be called by a keyboard shortcut. You set those in the _
    Tools...Macros menu item in Excel 2003 (or Developer...Macros menu item in Excel 2007 orlater) by clicking the Options button. _
    In this workbook, I chose CTRL + Shift + E for the keyboard shortcut
Sub ClearErrors()
'Clears all cells containing formulas that return error values. Replaces those formulas with the text in variable sError.
Dim ar As Range, rg As Range
Dim sError As String
sError = "No"   'Text to display in error cells
Set rg = Selection.SpecialCells(xlCellTypeFormulas, xlErrors)
If Not rg Is Nothing Then
    If rg.Cells.Count < 16084 Then
        rg.Value = sError
    Else
        For Each ar In rg.Areas
            ar.Value = sError
        Next
    End If
End If

End Sub

Open in new window

To run macro:
1) Select range of cells to be purged of error values
2) ALT + F8 to open macro selector. Choose the ClearErrors macro and hit Run button. If a keyboard shortcut has been set up (CTRL + Shift + E in this workbook) you may use that instead to launch the macro.

To install the macro:
1) ALT + F11 to open the VBA Editor
2) Use the Insert...Module menu item to create a blank module sheet.
3) Paste the code ther
4) ALT + F11 to return to the worksheet interface
5) Remember to save the file as .xls or .xlsm file extension. If you save it as .xlsx (the default), then the macro will be removed as part of the save.

Note: You may need to change macro security to Medium (Excel 2003 or earlier) or to "Disable all macros with notification" (Excel  2007 or later). You will then need to enable macros each time you open the workbook.

You do this in the Tools...Macros...Security menu item (Excel 2003) or Office icon ...Options...Trust Center...Trust Center Settings...Macro Settings menu item (Excel 2007). In Excel 2010, you use the File menu, then follow the same path as for Excel 2007.

Brad
ClearErrorsQ26837545.xlsm
0
 

Author Comment

by:pdvsa
ID: 34948532
Very nice... Appreciate your thoughtfulness knowing very well that the question has been awarded pts.   I thank you for taking the time...  
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

735 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