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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VBA to change cell format if cell causes error

Status
Not open for further replies.

bearnone

Programmer
Jan 7, 2003
10
US
I am working on a spreadsheet that uses formulas. I hopeing there is a function or VBA macro to react if the the cell input causes an error in the formula cell.

Moreover, I would love to display a msgbox or bubble notification if the user inputs incorrect iformation into a cell that causes an error in the formula that uses that information.

Thanks for any suggestions.
 
have you tried conditional formating and data validation?

they're in the menu drop downs
 
I have looked into data validation, but to tell conditionally that a formula in another cell is an error is proving impossible.
 
How about the is error function....

i.e.

=if(iserror(a1/b1),"Invalid Input",(a1/b1))


then do conditional format on cells containing "Invalid Input"
 
Or in the Conditional Format Box change the Cell Value Is to Formula Is, and put this formula:
=If(IsError(A1/B1),TRUE,FALSE)

HTH

Cheers
Nikki
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top