Grouping information in Excel is a way of hiding data, while telling the user there is data hidden. In my opinion it is a preferable way to "hide" information as you are aware that there is data grouped. Hidden rows in the conventional sense are often hard to detect. You may find out by accident after you have copied information that there were rows hidden. It is often a surprise.
The following will group like data if it is in a sequence (sorted first). It works nicely as it hides duplicated data leaving other unique items visible.
Dim i As Long
Dim j As Long
j = 0
For i = 2 To Range("A" & Rows.Count).End(xlUp).row
If Cells(i, "A") = Cells(i - 1, "A") Then
If j = 0 Then
Cells(i - 1, "A").EntireRow.Group
j = j + 1
Else: End If
j = 0
I will of course provide a working Excel file to go with the code.