Excellent! And thanks for the quick response.
So the code you posted does the initial 'inserting line before todays date'.
So can I then add the code in my original post after that to go through the rest of the sheets after todays date and add a line after each date change?
eg.....
Sub Deli()
Dim LastRow As Long, i As Long
LastRow = Cells(Rows.Count, 13).End(xlUp).Row
For i = LastRow To 2 Step -1
If Range("M" & i) = Date Then
Range("M" & i).Rows.EntireRow.Insert shift:=xlDown
Range("M" & i).EntireRow.Interior.Color = 5296274
End If
Next
Dim LastRow As Long, i As Long
LastRow = Cells(Rows.Count, 13).End(xlUp).Row
For i = LastRow To 2 Step -1
If Int(Range("M" & i).Value) <> Int(Range("D" & i - 1).Value) Then
Range("M" & i).Rows.EntireRow.Insert shift:=xlDown
End If
Next i
End Sub
Does the second part of the code need modifying to start after todays date? Much appreciated :-)
edit: It doesn't like having two Dim as Long. What can I change the second one to?
Bookmarks