Ask a question
Dim r As Long
Dim mcol As Date
Dim I As Long
' find last used cell in Column A
r = Cells(Rows.Count, "A").End(xlUp).Row
' get value of last used cell in column A
mcol = Cells(r, 1).Value
' insert rows by looping from bottom
For I = r To 2 Step -1
'if current value is not same as the current row being tested
If Cells(i, 1) <> mcol Then
'both values are not same, so insert row
Rows(i + 1).Insert
'change date by one day back
mcol = DateAdd("d", -1, mcol)
The Best of CCM in Your Inbox
The information gathered is for Communitic International to ensure the sending of the newsletter.
The information will be used subject to terms and conditions, for advertising purposes.
You reserve the right to access and change your personal data, aswell as the right to request its deletion within the limits permitted by law.