Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ReplaceErrorsInSetRange()
- Dim Rng As Range, selRng As Range, bError As Byte, myCell As Variant
- 'below you set own searched range
- Set Rng = Range("A1:Z1000")
- '=============================
- For Each myCell In Rng
- If myCell.Value <> "" Then
- If selRng Is Nothing Then
- Set selRng = myCell
- Else
- Set selRng = Union(selRng, myCell)
- End If
- End If
- Next
- If Not selRng Is Nothing Then selRng.Select
- For Each selRng In Selection.Cells
- For bError = 3 To 3 Step 1
- With selRng
- If .Errors(bError).Value Then .Errors(bError).Ignore = True
- End With
- Next
- Next
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement