Private Sub Workbook_BeforeClose(Cancel As Boolean)
Const ToBook = "ToBook.XLS"
Dim FromBook As String
Dim i As Integer
Dim j As Integer
Dim i2 As Integer
Dim j2 As Integer
Dim last_i As Integer
Dim last_i2 As Integer
Workbooks(FromBook).Sheets("Sheet1").Activate
i2 = last_i2
For i = 2 To last_i
If Cells(i, "E") = "" Then
i2 = i2 + 1
For j = 2 To 4
j2 = j - 1
Workbooks(ToBook).Sheets("Sheet1").Cells(i2, j2) = Cells(i, j)
Next
Cells(i, "E") = Date
End If
Next