title: VBA: How long does On Error Resume Next work?
body: <p>I'm reading up on how to use <code>On Error Resume Next</code> and I'm trying to figure out how long that line will apply to the program.  On the Microsoft site, I found this sentence: "An On Error Resume Next statement becomes inactive when another procedure is called."  What exactly does this mean?  What is considered to be a procedure?</p>
  
  <p>I ask because I'm using the line in my program, but I don't want it to <code>Resume Next</code> all the runtime errors which occur, just the obvious one on the next line.</p>
  
  <hr>
  
  <p>Code:</p>
  
  <pre><code>Dim zRange As Range
  
  Call FilterTableFor(fieldNameColumn, Array("baseunitprice", "burden", "MTLBURRATE", "PurPoint", "Vendornum"))
  
  On Error Resume Next
  Set zRange = commentsColumnRange.SpecialCells(xlCellTypeVisible)
  zRange.Formula = "target"
  
  Call FilterTableFor(fieldNameColumn)
  </code></pre>
  
  <hr>
  
  <p>I've also found (and known for a while) that <code>On Error</code> or <code>GoTo</code> lines are considered poor coding.  Is there a <code>Try-Catch</code> which I can use for a line like this?</p>
  
  <p>I'm thinking something like this:</p>
  
  <pre><code>Dim zRange As Range
  
  Call FilterTableFor(fieldNameColumn, Array("baseunitprice", "burden", "MTLBURRATE", "PurPoint", "Vendornum"))
  
  Try
  Set zRange = commentsColumnRange.SpecialCells(xlCellTypeVisible)
  zRange.Formula = "target"
  Catch()
  
  Call FilterTableFor(fieldNameColumn)
  </code></pre>
  
  <p>Where I don't even do anything with it, as I don't feel a need to.</p>
  
  <p>Thanks for your time.</p>