title: How to stop skipping lines of VBA code
body: <p>I have a macro that serves to validate data ("Validate") as part of a larger macro ("report"). My issue is that a small part of this validate macro won't run when I run the report macro; although, the validate macro will run perfectly if I run it separately after receiving the whole report. The chunk of code in bold is the offending section. What really confuses me is that the "Check Arrival Sheet" section, which is identical except for names, works perfectly.
  I've tried things like <code>DoEvents</code> and the like, with no success. Any ideas?</p>
  
  <p>Thanks</p>
  
  <pre><code>Sub Check_Ammo_type()
  '
  ' Ensures DATX compatability
  ' Checks Departure Sheet
  Sheets("Departures").Range("O3").Formula = "=Count(DepDesign)"
  Sheets("Departures").Range("O4").Formula = "=Count(DepOptimized)"
  Sheets("Departures").Range("P3").Formula = "=IF(DepOptimized[@Dest]=DepDesign[@Dest],""Check"",""Yikes"")"
  **With Range("M2").Select
          Selection.End(xlDown).Select
          ActiveCell.Offset(0, 3).Select
          Range(Selection, Selection.End(xlUp)).Select
          Selection.FillDown
          End With
  Range("Q3").Formula = "=COUNTIF(P:P,""=Yikes"")"**
  If Sheets("Departures").Range("Q3").Value &gt; 0 Then
       MsgBox "Market mismatch. Please ensure that design and optimized DAT files have the same markets."
      End If
  If Sheets("Departures").Range("O3").Value &lt;&gt; Sheets("Departures").Range("O4").Value Then
       MsgBox "Frequency mismatch. Please ensure that design and optimized DAT files have same frequencies."
      End If
  Columns("O:Q").Hidden = True
  
  ' Checks Arrival Sheet
  Sheets("Arrivals").Range("O3").Formula = "=Count(ArrDesign)"
  Sheets("Arrivals").Range("O4").Formula = "=Count(ArrOptimized)"
  Sheets("Arrivals").Range("P3").Formula = "=IF(ArrOptimized[@Orig]=ArrDesign[@Orig],""Check"",""Yikes"")"
          With Range("M2").Select
          Selection.End(xlDown).Select
          ActiveCell.Offset(0, 3).Select
          Range(Selection, Selection.End(xlUp)).Select
          Selection.FillDown
          End With
  Range("Q3").Formula = "=COUNTIF(P:P,""=Yikes"")"
  If Sheets("Arrivals").Range("Q3").Value &gt; 0 Then
       MsgBox "Market mismatch. Please ensure that design and optimized DAT files have the same markets."
  End If
  If Sheets("Arrivals").Range("O3").Value &lt;&gt; Sheets("Arrivals").Range("O4").Value Then
       MsgBox "Frequency mismatch. Please ensure that design and optimized DAT files have same frequencies."
  End If
  Columns("O:Q").Hidden = True
  
  End Sub
  </code></pre>