I have a list of names that are repeated every week. Whenever I include a new week row, it automatically hides the above first row of that name:

and after hiding the previous row, the first visible row should be highlighted like:

I tried the below code but I am unable to hide the above row and highlight the first visible row after hidden the previous row of each name.
Sub InserEmptyRows()
Dim i As Long
Application.ScreenUpdating = False
For i = Cells(Cells.Rows.count, "D").End(xlUp).Row To 5 Step -1
If Cells(i, "D") <> Cells(i - 1, "D") Then Rows(i).Insert Shift:=xlDown
Next i