Rows(2).Insert
Rows(1).Insert
Private Sub Workbook_Open()
Dim lastRow As Long
Dim lastDate As Date
' Go to sheet with prices
Sheets("WO Completed by Lab-Daily").Activate
' Find last row
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Exit if last date >= current date
If Cells(lastRow, "A") >= Date Then Exit Sub
' Loop to add in new rows
lastDate = Cells(lastRow, "A")
Do Until lastDate = Date
Rows(2).Insert
lastDate = lastDate + 1
Range("A2") = lastDate
Range("B3:G3").Copy Range("B2")
Loop
End Sub
Private Sub Workbook_Open()
Dim lastRow As Long
Dim lastDate As Date
' Go to sheet with prices
Sheets("WO Completed by Lab-Daily").Activate
' Find last row
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
' Exit if last date >= current date
If Cells(lastRow, "A") >= Date Then Exit Sub
' Loop to add in new rows
lastDate = Cells(lastRow, "A")
Do Until lastDate = Date
lastDate = lastDate + 1
lastRow = lastRow + 1
Cells(lastRow, "A") = lastDate
Range("B2:G2").Copy Cells(lastRow, "B")
Loop
End Sub
"Workbook_Open" event procedures are already meant to do exactly that - run automatically whenever the workbook is opened.Now will it do that automatically every time I open the document. I would like for it to update to the current date whenever the file gets opened.