Link to home
Start Free TrialLog in
Avatar of Naresh Patel
Naresh PatelFlag for India

asked on

Delete Hide Display

Hi Expert,

Is there any way to delete all error messages from whole sheet?  Hide & Display as per required.

i had attached file in which there is few error messages i want to delete that by clicking Delete Button.
i have two more buttons Hide & Display - if there is the  case that if i want that formula remain in the sheet - so hide out buy changing text color of error messages to its background (Cell Specific background color) color &  on click of display button all error message revert to its original or black color.



Thanks
Error-Remove.xlsm
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Created by using the Macro recorder, this line will select all formulas that result in an error:

Selection.SpecialCells(xlCellTypeFormulas, 16).Select

Open in new window

Thanks
Rob H
Alternatively, if there are specific cells that you know could give an error result, incorporate an IF statement into the formula using a separate input cell to decide whether an error should be shown or not, eg A1 could be Hide or Show, the value of which could be changed by the button then a formula such as the erroneous division in would change to:

=IF(A1="Hide",IFERROR(C6/D6,""),C6/D6)

Thanks
Rob H
Avatar of Naresh Patel

ASKER

May i have sample book pls....
ASKER CERTIFIED SOLUTION
Avatar of Jacques Geday
Jacques Geday
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes this is what i want. only last thing do i able to use this function or code to all file in my pc for all user by creating button in quick access tool bar? or any kind of add in tab?
are you referring to my solution ???
gowflow
If you are pointing to my solution then there is a tweak we can create to have this available to all workbooks which will be by creating a menu to access all this. But then it has to be designed differently.

If you want and you like this simply accept this one and post a new one with link too this question and I will be glad to do it for you as will need to get all this in module then built menu to access each one on its own ....

gowflow