First off... did you read Message #6 yet? You will need to adhere to that in the future. Also, be nice and post the link back to this thread in your MrExcel thread there so that the volunteers there do not waste their time trying to solve your now solved problem.
Here is the revised code for data starting in cell A4...
Sub FillInMissingTimeSlots()
Dim R As Long
Application.ScreenUpdating = False
For R = Cells(Rows.Count, "A").End(xlUp).Row To 5 Step -1
If Minute(Cells(R, "A").Value) - Minute(Cells(R - 1, "A")) > Minute(TimeSerial(0, 1, 0)) Then
Cells(R, "A").Resize(Minute(Cells(R, "A").Value) - Minute(Cells(R - 1, "A").Value) - 1).EntireRow.Insert
End If
Next
On Error GoTo NoBlanks
With Range("A4", Cells(Rows.Count, "A").End(xlUp))
.SpecialCells(xlBlanks).FormulaR1C1 = "=R[-1]C+TIME(0,1,0)"
.Value = .Value
End With
NoBlanks:
Application.ScreenUpdating = True
End Sub
In the future, you should give us the relevant information like this so we don't have to go back and modify our solutions for you.
Bookmarks