title: After Running Macro Excel will not close, sheet will not scroll, and arrow key causes selection to jump wildly
body: <p>I have created a report template that allows users to select various filters and then creates specific reports based on those filters. Below is the code for the filter selection button:</p>
  
  <pre><code>Sub Filter_Select()
   rptSelect.Show
  End Sub
  </code></pre>
  
  <p>After this, users are presented with UserForms to select different filters. Each UserForm calls the next user form until they reach the last UserForm whose code is such:</p>
  
  <pre><code>Private Sub UserForm_Activate()
      With milSelect
          .Top = Application.Top + 250
          .Left = Application.Left + 250
      End With
  End Sub
  --------------------------------------------------
  Private Sub UserForm_Initialize()
      milDV.RowSource = Range("Q1:Q8").Address
  End Sub
  --------------------------------------------------
  Private Sub CancelmilSelect_Click()
      Unload Me
  End Sub
  --------------------------------------------------
  Private Sub OKmilSelect_Click()
      Sheets("Report Selection").Unprotect
      Range("B6").ClearContents
  
      Range("B6") = milDV.Text
  
      Unload Me
  
      Call Create_Report
  End Sub
  </code></pre>
  
  <p>Once they select the final filter, the Create_Report macro is run to determine which reports to create and what formulas to use based on the filters selected. The code is as such:</p>
  
  <pre><code>Option Explicit
  Sub Create_Report()
  '
  '   Macro to update fields in different reporting sections after user selects report type
  '
  
  '
      Application.EnableEvents = False
      Application.Calculation = xlCalculationManual
      Application.ScreenUpdating = False
  '
  '   Display Tabs
  '
      Dim z As Integer
          For z = 2 To Worksheets.Count
              Sheets(z).Visible = xlSheetHidden
          Next z
      If Range("B1").Value = "National" And Range("B6") = "Military" Then
          Sheets("Program Summary").Visible = xlSheetVisible
      Else
          If Range("B1") = "National" Then
              Sheets("Program Summary").Visible = xlSheetVisible
              Sheets("Family &amp; Household Demographics").Visible = xlSheetVisible
              Sheets("Registered Member Dues").Visible = xlSheetVisible
          Else
              Sheets("Program Summary").Visible = xlSheetVisible
              Sheets("Summary").Visible = xlSheetVisible
              Sheets("Financial Summary").Visible = xlSheetVisible
          End If
      End If
  '
  '   Financial Summary
  '
      If Sheets("Financial Summary").Visible = True Then
      Sheets("Financial Summary").Select
      Sheets("Financial Summary").Unprotect
  '
  '       Name Ranges
  '
          Dim Operating_Expenses, Income_Private1, Income_Private2, Income_Private3, Income_Gov, Income_Other1, Income_Other2 As Range
          Set Operating_Expenses = Range("C5:C7")
          Set Income_Private1 = Range("C13")
          Set Income_Private2 = Range("C14:C16")
          Set Income_Private3 = Range("C17")
          Set Income_Gov = Range("C19:C22")
          Set Income_Other1 = Range("C25:C26")
          Set Income_Other2 = Range("C27:C30")
  '
  '       State Non-Military Financial Summary
  '
          If Worksheets("Report Selection").Range("B1").Value = "State" Then
              If Worksheets("Report Selection").Range("B6").Value = "Non-Military" Then
                  Range("B1").Value = Worksheets("Report Selection").Range("B4").Value
                  Range("C1").Value = "Non-Military"
                  Operating_Expenses.Formula = "=SUMIFS(INDEX('Financial Data'!$BE:$BG, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Private1.Formula = "=SUMIFS(INDEX('Financial Data'!$AO:$AO, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Private2.Formula = "=SUMIFS(INDEX('Financial Data'!$AL:$AN, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Private3.Formula = "=SUMIFS(INDEX('Financial Data'!$AQ:$AQ, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Gov.Formula = "=SUMIFS(INDEX('Financial Data'!$BA:$BD, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Range("C24").Formula = "=SUMIFS('Financial Data'!$AP:$AP,'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Other1.Formula = "=SUMIFS(INDEX('Financial Data'!$AV:$AW, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Income_Other2.Formula = "=SUMIFS(INDEX('Financial Data'!$AR:$AU, 0, ROW(1:1)),'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Range("C31").Formula = "=SUMIFS('Financial Data'!$AZ:$AZ,'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Range("C32").Formula = "=SUMIFS('Financial Data'!$AY:$AY,'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
                  Range("C33").Formula = "=SUMIFS('Financial Data'!$AK:$AK,'Financial Data'!$E:$E,$B$1,'Financial Data'!$H:$H,""0"")"
              End If
          End If
      End If
  '
  '   Select First Sheet of Report
  '
      Dim i As Integer
      Dim ws As Worksheet
      For i = 1 To Worksheets.Count
          If Sheets(i).Visible = True Then
              Sheets(i).Protect
          End If
      Next i
      For i = 2 To Worksheets.Count
          If Sheets(i).Visible = True Then
              Sheets(i).Select
              Exit For
          End If
      Next i
      Application.EnableEvents = True
      Application.Calculation = xlCalculationAutomatic
      Application.ScreenUpdating = True
  End Sub
  </code></pre>
  
  <p>All of the code runs properly and the reports are created, but I'm having a bug where when I try to scroll on the sheet that is displayed after the code runs, the scroll bar moves but the cells seem stuck in place. If I try to select a cell and move with the arrow key, the selection jumps around. Both of these things are solved by going to another sheet and then coming back.</p>
  
  <p>Additionally, after this code runs, I cannot close Excel with any method other than through Task Manager. Since none of this happens when I first open the workbook, I am left to assume that my above code is somehow causing this.</p>