• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

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
0
Seamus2626
Asked:
Seamus2626
  • 2
  • 2
  • 2
2 Solutions
 
Rory ArchibaldCommented:
Do you just want #N/A errors, or all errors?
0
 
Seamus2626Author Commented:
All errors now you say it, thanks
0
 
Rory ArchibaldCommented:
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
[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

 
StephenJRCommented:
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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now