Suppress Error Message not working

lukestkd

Board Regular
Joined
Jul 30, 2012
Messages
57
Hello all,
I am trying to suppress the error message (green triangle top left corner of cell). I have tried
Code:
On Error Resume Next
On Error GoTo 0


At the start and end of code, but to no avail. Does anyone have any suggestions? Many Thanks! Luke


Code:
Sub mcrpasteformulaandcommentlist()
On Error Resume Next
On Error GoTo 0
    ActiveWindow.SmallScroll Down:=23
    Range("C50").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(R[-43]C[1]=""y"",(CONCATENATE(""Well Done "",LEFT(R4C3,FIND("" "",R4C3)-1),"" you have completed "",R[-43]C[-2],"" "",R[-43]C)),IF(R[-43]C[1]=""n"",CONCATENATE(""Please use the "",R[-43]C[-2],"" user guide to complete "",R[-43]C),IF(R[-43]C[1]=""I"",""Teacher Comment Required"","""")))"
    Range("C51").Select
    ActiveWindow.SmallScroll Down:=-36
    Range("G7").Select
    ActiveCell.FormulaR1C1 = _
        "=IF(RC[-3]=""y"",(CONCATENATE(""Well Done "",LEFT(R4C3,FIND("" "",R4C3)-1),"" you have completed "",RC[-6],"" "",RC[-4])),IF(RC[-3]=""n"",CONCATENATE(""Please use the "",RC[-6],"" user guide to complete "",RC[-4]),IF(RC[-3]=""I"",""Teacher Comment Required"","""")))"
    Range("G7").Select
    Selection.AutoFill Destination:=Range("G7:G26")
    Range("G7:G26").Select
    Range("G7:G26").Select
    Range("G8").Activate
 


Range("G7").Select
With Selection.Validation
        .Delete
        .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
        xlBetween, Formula1:="=Comments!$A$3:$A$7"
        .IgnoreBlank = True
        .InCellDropdown = True
        .InputTitle = ""
        .ErrorTitle = ""
        .InputMessage = ""
        .ErrorMessage = ""
        .ShowInput = False
        .ShowError = False
    End With
End Sub
 
To get rid of the annoying green triangle, you need to turn off Error Checking:

Application.ErrorCheckingOptions.BackgroundChecking = False

HTH,
 
Upvote 0
I am trying to suppress the error message (green triangle top left corner of cell). I have tried
Code:
On Error Resume Next
On Error GoTo 0

At the start and end of code, but to no avail. Does anyone have any suggestions? Many Thanks! Luke

Code:
Sub mcrpasteformulaandcommentlist()
[B][COLOR=#A52A2A]On Error Resume Next
On Error GoTo 0[/COLOR][/B]
    ActiveWindow.SmallScroll Down:=23
 
*** Rest of code snipped ***
I know you got your answer about the green triangles already, but I wanted to address your use of the On Error statements for future reference. The "On Error GoTo 0" statement turns off the error checking, so by putting the two highlighted lines of code following one another like you did simply turns error checking on and then immediately turns it off again. The idea for using "On Error Resume Next" is you place it before an line of code that could error out for one reason or another, then depending on program flow, you normally would check the Err.Number to see if it were 0 (no error) or not 0 (an error occurred) and take appropriate action. Any time after the Err.Number check, you would execute the "On Error GoTo 0" statement to turn error checking back off (so as not to hide subsequent errors that you were not anticipating nor handling in your code).
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top