Quantcast
Channel: Bacon Bits
Viewing all articles
Browse latest Browse all 33

Quickly Wrap Formulas in IFERROR without VBA

$
0
0

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.

  1. Sub Add_IFERROR()
  2. Dim R As Range
  3.  
  4. For Each R In Selection.SpecialCells(xlCellTypeFormulas)
  5.  
  6.      If Left(R.Formula, 8) <> "=IFERROR" Then
  7.           R.Formula = "=IFERROR(" & Mid(R.Formula, 2) & ","""")"
  8.      End If
  9. Next R
  10.  
  11. End Sub

Viewing all articles
Browse latest Browse all 33

Trending Articles