Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide errors

Status
Not open for further replies.

e2the1stpower

Technical User
Apr 15, 2008
8
US
How do I hide errors such as #VALUE! in excel 2002 using VBA?
 
Sorry for the double post but I forgot to mention that instead of the error showing up I want it to say Open or something like that.
 
You would really need to change the formula to do that:
=If(iserror(originalformula,"Open",OriginalFormula)
Various errors will be trapped like this.

If you didn't want to change all the formulae in the workbook then:
Edit, goTo, Special,Errors to select just the cells to change.

Macro recorder will convert that to VBA code.

For each c in selection
c.formula = "=If(iserror(" + c.formula + ",""Open""," + c.formula + ")"
Next c

Now that was untested but should get you started. If you have any problems on the VBA side then you should post in forum707.




Gavin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top