Private Sub CreateTable()
Dim frstRow As Long, lstRow As Long, cnt As Long, i As Long, j As Long
Dim rng As Range
Dim TableName As String
cnt = 0
Do While (ActiveCell.Offset(cnt, 0).Value = ActiveCell.Offset(cnt - 1, 0).Value)
cnt = cnt - 1
Loop
frstRow = ActiveCell.Row + cnt
cnt = 0
Do While (ActiveCell.Offset(cnt, 0).Value = ActiveCell.Offset(cnt + 1, 0).Value)
cnt = cnt + 1
Loop
lstRow = ActiveCell.Row + cnt
Set rng = Application.Range("Complaints!A" & frstRow & ":K" & lstRow)
With rng
.Sort Key1:=.Range("Complaints!D" & frstRow & ":D" & lstRow), Order1:=xlAscending _
, Key2:=.Range("Complaints!E" & frstRow & ":E" & lstRow), Order1:=xlAscending _
, Key3:=.Range("Complaints!F" & frstRow & ":F" & lstRow), Order1:=xlAscending, Header:=xlGuess
End With
Set rng = Application.Range("Complaints!A" & frstRow & ":K" & lstRow)
TableName = "SpeciesTbl"
ActiveSheet.ListObjects.Add(xlSrcRange, rng, , xlYes).Name = TableName
End Sub