I have a list of names which repeated every week, whenever i include new week row automatically hide the above first row of that name enter image description here and after hidden the previous row, first visible row should be highlight.
Example is below :
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. kindly advise. Thanks
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