Skip to content

Instantly share code, notes, and snippets.

@wbhinton
Created January 15, 2020 22:27
Show Gist options
  • Save wbhinton/07aef2a44e0e57ebe95a149d42defb1f to your computer and use it in GitHub Desktop.
Save wbhinton/07aef2a44e0e57ebe95a149d42defb1f to your computer and use it in GitHub Desktop.
Apply IFERROR to all formulas within a selected range

Apply IFERROR to all formulas within a selected range

Create a macro with the following code.

Then select the range of formulas and run the code.

Sub InsertIFERROR()
    Dim R As Range
    For Each R In Selection.SpecialCells(xlCellTypeFormulas)
        R.Formula = "=IFERROR(" & Mid(R.Formula, 2) & ",""N/A"")"
    Next R
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment