Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 445

If include the row below after the last name of every person, automatically the first visible name row should be hidden

$
0
0

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 :

enter image description here

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


Viewing all articles
Browse latest Browse all 445

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>