Formula for week ending

N

Nelix

Hi

I am putting together a time sheet to record working times from week to
week, I have a cell that contains the week ending date using the following
formula:

=TODAY()-WEEKDAY(TODAY(),2)+7

I need to make this cell only update if the file is saved, basically so that
if I open an old timesheet from say last week it wont change the week ending
date to this weeks.

Does that make sense?? lol

Hope someone can help
 
S

Sheeloo

The only way to do that is to convert the formula to a value before saving...
i.e Copy and then Paste Special | Values

You can record a macro while doing that and then run that macro whenever you
want...
 
B

Bernd P

Hello,

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Range("A1") = Application.WorksheetFunction.Floor(CLng(Date) + 5,
7) + 1
End Sub


Regards,
Bernd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top