Hi again Matt,
Macro below. You didn’t tell me where to copy the daily total from so I just
dummied a total for testing purposes. Can you fix that part or if not, can
you give me some info as per my previous posting.
You will have to initialize the first date at cell A15. (Or any cell in
column A so long as it does not have any data in cells below it otherwise the
macro will fail). Just put yesterdays date in. The macro needs this to run.
You will see that it always appends today’s date to the bottom of the list
and then tomorrow it will enter the total against the existing date. That way
I was able to use the date at the bottom of the list to determine if the
macro has been run. Also it will ignore any days that the workbook is not
opened.
I don’t know what part of the world you are in so you may have to edit the
date format. In case you are not fully familiar with custom formatting dates,
the format I have used of “ddd dd mmm yyyy†will display a date as Wed 19 Sep
2007 which achieves the day of the week and the date together.
Private Sub Workbook_open()
Dim dateToday As Date
Dim rngLastDate As Range
Dim lastDayTot As Variant
dateToday = Date
'Following line needs to be edited to pick
'up the total from your worksheet
lastDayTot = 10
With Sheets("Daily Tracking")
Set rngLastDate = .Cells(Rows.Count, 1).End(xlUp)
If rngLastDate.Value <> dateToday Then
rngLastDate.Offset(0, 1) = lastDayTot
rngLastDate.Offset(1, 0) = dateToday
'Edit date format to your requirements
.Columns("A:A").NumberFormat _
= "ddd dd mmm yyyy"
.Columns("A:A").Columns.AutoFit
End If
End With
End Sub
Feel free to get back to me if you have any problems with it.
Regards,
OssieMac