Is there a simple way to enumerate the errors in a range?
I tried to use the following code, but it does not work
Dim err As Object
For Each err In Plan10.Range("M2:AB8000").Errors
Debug.Print err.Value
Next err
I know from the documentation, that I can’t simply enumerate errors using the range.errors.
I solved the problem scanning every error in every cell in the range, but it is painfully slow
Is there a better way to do the job?
You can use
SpecialCellsto retrieve cells that contain/evaluate to errorsThe error handling avoids
VBAerrors if there are no error cells in the range being searchedYou can then work through the error ranges (if present in
rng1andrng2) as required