Here’s a quick tip for quickly wrapping all formulas in IFERROR without VBA.
1. Select the cells that contain the formulas you want wrapped in IFERROR.
2. Press F5 on your keyboard to activate
the GoTo dialog box, then click Special.
3. Select Formulas and press the OK button
4. In the Formula bar, enter the IFERROR function you’d like to use, then press CTRL+ENTER. Pressing Ctrl+Enter is important here. Make sure you don’t press just the Enter key.
5. Marvel at your efficiency.
Of course, this handy trick only works if all your formulas are performing similar calculations (referencing the same relative cells). If want to wrap formulas that are performing different operations, you’ll need to use some VBA. Here’s a quick and dirty macro that wraps selected formulas in IFERROR.
- Sub Add_IFERROR()
- Dim R As Range
- For Each R In Selection.SpecialCells(xlCellTypeFormulas)
- If Left(R.Formula, 8) <> "=IFERROR" Then
- R.Formula = "=IFERROR(" & Mid(R.Formula, 2) & ","""")"
- End If
- Next R
- End Sub