Some changes:
Sub blah()
Dim NewSht As Worksheet, LastTable As ListObject
Set Rng = Sheets("Database").Cells(1).CurrentRegion
Set Rng = Intersect(Rng, Rng.Offset(1)).Resize(, 1)
'Rng.Select
CurrentCat = ""
EndTime = Application.WorksheetFunction.Floor_Math(Time, 1 / 24)
For Each cll In Rng.Cells
If cll.Value <> CurrentCat Then
If Not NewSht Is Nothing Then NewSht.Columns("B:B").EntireColumn.AutoFit
Set NewSht = Sheets.Add(after:=Sheets(Sheets.Count))
NewSht.Name = cll.Value
CurrentCat = cll.Value
End If
Set Destn = NewSht.Cells(Rows.Count, "B").End(xlUp).Offset(2)
If Not LastTable Is Nothing Then LastTable.Unlist
With Destn
.Value = cll.Offset(, 1).Value
With .Font
.Name = "Calibri"
.Size = 11
.Underline = xlUnderlineStyleSingle
.Bold = True
End With
End With
Set Destn = Destn.Offset(2)
Destn.Resize(, 13).Value = Array("Hourly Table", "Column 1", "Column 2", "Column 3", "Column 4", "Column 5", "Column 6", "Column 7", "Column 8", "Column 9", "Column 10", "Column 11", "Column 12")
Set Destn = Destn.Offset(1)
StartTime = cll.Offset(, 3).Value
If TypeName(StartTime) = "String" Then StartTime = TimeValue(StartTime)
' EndTime = cll.Offset(, 4).Value
' If TypeName(EndTime) = "String" Then EndTime = TimeValue(EndTime)
For hr = StartTime To EndTime Step 1 / 24
Destn.Value = hr
Destn.NumberFormat = "hh:mm AM/PM"
Set Destn = Destn.Offset(1)
Next hr
Set LastTable = NewSht.ListObjects.Add(xlSrcRange, Destn.Offset(-1).CurrentRegion, , xlYes)
With LastTable
.TableStyle = "TableStyleMedium14"
.ShowTableStyleRowStripes = False
'.Unlist
End With
Next cll
If Not LastTable Is Nothing Then LastTable.Unlist
If Not NewSht Is Nothing Then NewSht.Columns("B:B").EntireColumn.AutoFit
End Sub
The end time is the current time rounded down to the nearest hour. If you want it rounded up to the nearest hour then change Floor_Math to Ceiling_Math.
I've had a go at some formatting by temporarily converting to listobjects (Tables) and then converting back to a plain ranges.
If a sheet already exists, what do you want to happen?
I'll stop there and wait to hear from you.