NA Error

Hi,

Im looking for a little sub i can run that will find any #N/A Errors and clear the contents of those cells

The tab is called "Output"

Thanks
Seamus
Seamus2626Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Rory ArchibaldConnect With a Mentor Commented:
Try this then:
Sub ClearErrors()
   Dim rng As Range
   On Error Resume Next
   Set rng = Sheets("Output").UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors)
   If Not rng Is Nothing Then rng.ClearContents
   Set rng = Sheets("Output").UsedRange.SpecialCells(xlCellTypeConstants, xlErrors)
   If Not rng Is Nothing Then rng.ClearContents

End Sub

Open in new window

0
 
Rory ArchibaldCommented:
Do you just want #N/A errors, or all errors?
0
 
Seamus2626Author Commented:
All errors now you say it, thanks
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
StephenJRConnect With a Mentor Commented:
Try this:
Sub x()

Dim r As Range

For Each r In Sheets("Output").UsedRange.SpecialCells(xlCellTypeFormulas, xlErrors)
    If r.Value = CVErr(xlErrNA) Then r.ClearContents
Next r

End Sub

Open in new window

0
 
StephenJRCommented:
OK, hadn't seen change to request.
0
 
Seamus2626Author Commented:
Thanks guys,

Cheers,
Seamus
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.