How Excel stores Dates & Times:
Excel uses a 'serial' number system to store dates (first day is January 1, 1900):
01/01/1900 = 1
01/02/1900 = 2
Time is represented by anything after the decimal (noon is .5 because it's halfway through the day):
01/01/1900 12:00 = 1.5
01/02/1900 15:00 = 2.625
If you filter based on values, it's important to be aware of this.
Include this code in your module:
Public Function GetDay(ByVal inputDate As String) As String
GetDay = WeekdayName(Weekday(inputDate))
End Function
Public Function GetHour(ByVal inputDate As Range) As String
GetHour = Format(inputDate.Value, "Medium Time")
End Function
Now use these functions on your worksheet and AutoFill:
In your existing code modify the following:
With Range("D2")
.AutoFilter Field:=4, Criteria1:="10:?? PM"
'If criteria didn't match anything, cCnt is equal to 1 (because header rows are visible and counted)
cCnt = ActiveSheet.AutoFilter.Range.Columns(4).SpecialCells(xlCellTypeVisible).Cells.Count
If cCnt > 1 Then
For Each cell In Range("D2:D" & cCnt)
Hour10PM = Hour10PM + 1
Next
End If
MsgBox (Hour10PM & " matches for 10:00PM to 10:59PM")
.AutoFilter Field:=4, Criteria1:="11:?? PM"
cCnt = ActiveSheet.AutoFilter.Range.Columns(4).SpecialCells(xlCellTypeVisible).Cells.Count
If cCnt > 1 Then
For Each cell In Range("D2:D" & cCnt)
Hour11PM = Hour11PM + 1
Next
End If
MsgBox (Hour11PM & " matches for 11:00PM to 11:59PM")
End With
Additional Notes:
Obviously I just gave a snippet of code, but the idea would be that you could split and keep count of every hour. Then to graph it should be simple.