Try:
Sub CreateReport()
Application.ScreenUpdating = False
Dim LastRow As Long
LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Dim sDate As String
Dim eDate As String
sDate = InputBox("Please enter the start date in format mm/dd/yyyy", "Enter Start Date", "mm/dd/yyyy")
eDate = InputBox("Please enter the end date in format mm/dd/yyyy", "Enter End Date", "mm/dd/yyyy")
ActiveSheet.ListObjects("Table_Query_from_MS_Access_Database3").Range. _
AutoFilter Field:=3, Criteria1:=">=" & CDate(sDate), Operator:=xlAnd, Criteria2:="<=" & CDate(eDate)
Range("C1") = WorksheetFunction.Min(Range("D12:D" & LastRow).SpecialCells(xlCellTypeVisible))
Range("C2") = WorksheetFunction.Max(Range("D12:D" & LastRow).SpecialCells(xlCellTypeVisible))
Range("C3") = WorksheetFunction.Average(Range("D12:D" & LastRow).SpecialCells(xlCellTypeVisible))
Application.ScreenUpdating = True
End Sub
Bookmarks