Ignoring Error's no longer working

eli_m

Board Regular
Joined
Jun 2, 2022
Messages
153
Office Version
  1. 365
Platform
  1. Windows
Hi,

I've had this code working for over 3 years now:

VBA Code:
' Ignore Errors when Worksheet Activated
Private Sub Worksheet_Activate()

Dim r As Range: Set r = Range("A2:AQ200")
Dim cel As Range

For Each cel In r
  With cel
    .Errors(8).Ignore = True 'Data Validation Error
    .Errors(9).Ignore = True 'Inconsistent Error
    .Errors(6).Ignore = True 'Lock Error
  End With
Next cel

End Sub


But today it is no longer working.

On my PC my excel version is:
1705289868642.png

and the code no longer works.

But on my laptop I have a slightly older version of excel (Version 2302 Build 16130.20868) and it works fine.

I am guessing the update has broken something or it has changed somehow.

Is there a few way to ignore errors in a certain part of a spreadsheet?

Thanks in advance :)
 

Attachments

  • 1705289857567.png
    1705289857567.png
    2.3 KB · Views: 32

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
On error resume next. It is best to find out what the error is though.
 
Upvote 0
My laptop has just updated after a few days and now the code is not working on there also.

Is there another way to ignore errors for everyone who opens my spreadsheet?

Thanks!
 
Upvote 0
Does it work if you change them all ?

VBA Code:
' Ignore Errors when Worksheet Activated
Private Sub Worksheet_Activate()

Dim r As Range: Set r = Range("A2:AQ200")
Dim cel As Range
Dim i As Long
Dim arrErrortypes As Variant

arrErrortypes = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)

For i = 0 To UBound(arrErrortypes) - 1
    For Each cel In r
      With cel
        .Errors(arrErrortypes(i)).Ignore = True
      End With
    Next cel
Next i

End Sub
 
Upvote 0
Does it work if you change them all ?

VBA Code:
' Ignore Errors when Worksheet Activated
Private Sub Worksheet_Activate()

Dim r As Range: Set r = Range("A2:AQ200")
Dim cel As Range
Dim i As Long
Dim arrErrortypes As Variant

arrErrortypes = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)

For i = 0 To UBound(arrErrortypes) - 1
    For Each cel In r
      With cel
        .Errors(arrErrortypes(i)).Ignore = True
      End With
    Next cel
Next i

End Sub

I tried your code and sadly not - I am wondering if this is a update issue or if they have updated the way to ignore errors but I can't seem to find anything.
 
Upvote 0
Silly me!
I've added a few more errors to the list and now it works:

.Errors(6).Ignore = True 'Lock Error
.Errors(7).Ignore = True 'Unprotected Forumla Error
.Errors(8).Ignore = True 'Data Validation Error
.Errors(9).Ignore = True 'Inconsistent Error
.Errors(10).Ignore = True 'Inconsistent Calculated Column Formula Error
 
Upvote 0
Solution

Forum statistics

Threads
1,223,162
Messages
6,170,431
Members
452,326
Latest member
johnshaji

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