title: VBA Inputbox Filter enhancements
body: <p>the code below works fine. However, when a user doesn't include anything in the InputBox <strong>or</strong> clicks on the 'Close' button <strong>or</strong> inputs a value which doesn't exist I want it to display a msgbox stating the reason and delete sheets 'PreTotal'. </p>
  
  <p>Is there a better way to handle user input? Need some help here on how to go about it. Thank you.</p>
  
  <pre><code>Sub Filterme()
      Dim wSheetStart As Worksheet
      Dim rFilterHeads As Range
      Dim strCriteria As String
  
      Set wSheetStart = ActiveSheet
      Set rFilterHeads = Range("M1", Range("M1").End(xlToLeft))
  
      With wSheetStart
          .AutoFilterMode = False
  
          rFilterHeads.AutoFilter
  
          strCriteria = InputBox("Enter Date - MMDDYY")
  
          If strCriteria = vbNullString Then Exit Sub
  
          rFilterHeads.AutoFilter Field:=13, Criteria1:="=*" &amp; strCriteria &amp; "*"
      End With
  
      Worksheets("PreTotal").UsedRange.Copy
  
      Sheets.Add.Name = "Total"
  
      Worksheets("Total").Range("A1").PasteSpecial
  
  End Sub
  </code></pre>