I couldn't get it to work, so I opted for another solution as follows;
[blue]If Sheets("yesd").Range("A7").Value = 0 Then
MsgBox "Yesterday adjusted earlier today", 48, "END CODE"
Exit Sub
End If[/blue]
In the "yesd" sheet in cell A3 is =today()
In the "yesd" sheet in cell A5 is a pastespecial-value of cell A3 the last time the macro ran
In the "yesd" sheet in cell A7 is =A3-A5
Therefore when the workbook is open on the same day the macro will not
run because the value in cell A7 is 0
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.