title: excel multiple on error goto
body: <p>I am trying to get multiple on error statements to work and can't figure it out.</p>
  
  <p>If pdf can be found in local then open, if not then open network location. If there is no PDF in then return msgbox.</p>
  
  <pre><code>Sub Cutsheets()
  Application.ScreenUpdating = False
  
  Dim finalrow As Integer
  
  finalrow = Cells(Rows.Count, 1).End(xlUp).Row
  On Error GoTo net1
  
  If Not Application.Intersect(ActiveCell, Range("A9:A" &amp; finalrow)) Is Nothing Then
      'Local Location
  ActiveWorkbook.FollowHyperlink "C:\Local" &amp; ActiveCell &amp; ".pdf"
  Application.SendKeys "{ENTER}", True
  End If
  Exit Sub
  
  net1:
  If Not Application.Intersect(ActiveCell, Range("A9:A" &amp; finalrow)) Is Nothing Then
      'Network Location
  On Error GoTo whoa
  ActiveWorkbook.FollowHyperlink "P:\Network" &amp; ActiveCell &amp; ".pdf"
  Application.SendKeys "{ENTER}", True
  End If
  Exit Sub
  
  whoa:
  MsgBox ("No cutsheet can be found for this item.")
  
  Application.ScreenUpdating = True
  
  End Sub
  </code></pre>
  
  <p>Also I don't remember why I put <code>sendkeys</code> in there but it doesn't work without it.</p>