Try this in the workbook module
Option Explicit
Private Sub Workbook_Open()
Dim LastRow As Long, RowNo As Long
With Sheets("Sheet1")
LastRow = .Range("A" & Rows.Count).End(xlUp).Row
If .Range("A" & LastRow) < Date - 1 Then
If .Range("A" & LastRow).Offset(0, 1) = "" Then
.Range("A" & LastRow).Offset(0, 1) = .Range("A" & LastRow).Offset(-1, 1)
.Range("A" & LastRow).Offset(0, 2) = "Automated Entry"
End If
For RowNo = LastRow To LastRow + Date - .Range("A" & LastRow) - 1
If .Range("A" & RowNo + 1) = "" Then
.Range("A" & RowNo + 1) = .Range("A" & RowNo) + 1
If .Range("A" & RowNo + 1) <> Date Then
.Range("A" & RowNo + 1).Offset(0, 1) = .Range("A" & RowNo + 1).Offset(-1, 1)
.Range("A" & RowNo + 1).Offset(0, 2) = "Automated Entry"
End If
End If
Next
End If
End With
End Sub
When you open this demo with macros enabled it will automatically add the missing data.
To test
Delete the last few rows (A:C) save the workbook, close, and reopen.
then
Delete the last few rows (A:C) plus what becomes the last row Column B, save the workbook, close, and reopen
Note: This will not fill missing entries in old sheets with missing data, it will only work from the last entered date forward.
Bookmarks