Remove Error Triangles

User avatar
SammyB
StarLounger
Posts: 93
Joined: 04 Mar 2010, 16:32

Remove Error Triangles

Post by SammyB »

I have a spreadsheet that has some error triangles for inconsistent formulas. They are not: if they were I would fix them, lol.

I know how to run a macro to turn them off:

Code: Select all

Sub clearInconsistent()
    Dim c As Range
    For Each c In ActiveSheet.UsedRange.Cells
        If c.Errors(xlInconsistentFormula).Value Then c.Errors(xlInconsistentFormula).Ignore = True
    Next c
End Sub
I want to do something like that in the code that creates the formulas, but c.Errors(xlInconsistentFormula).Value is always false until the macro stops running. Is there someway in VBA to get Excel to turn on the error triangles? I was hoping Application.Calculate would do it, but it doesn't

Just trying to avoid running two macros. Thanks!

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Remove Error Triangles

Post by HansV »

As far as I can tell, there is no way to force Excel to activate error triangles while the macro runs.
So I'd call clearInconsistent at the end of the other macro.
Best wishes,
Hans

User avatar
SammyB
StarLounger
Posts: 93
Joined: 04 Mar 2010, 16:32

Re: Remove Error Triangles

Post by SammyB »

Thanks, Hans! Always good to have confirmation.