Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Dm76
 
Posts: n/a
Default auto working week-ending date for timesheet

I would like to have an auto updating date for a timesheet. At the start of
the week the date would show the date at the end of the week. At the start of
each week the date would change to the end date of that week.
  #2   Report Post  
Biff
 
Posts: n/a
Default

Hi!

It's not real clear what you want.

If you want a date that is always the Sunday of that week:

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

Biff

"Dm76" wrote in message
...
I would like to have an auto updating date for a timesheet. At the start of
the week the date would show the date at the end of the week. At the start
of
each week the date would change to the end date of that week.



  #3   Report Post  
Dm76
 
Posts: n/a
Default

Thanks that worked well. Is it possible to have the function only update when
the file is saved and not at any other time. e.g. when opened or data changed
in the cell?

"Biff" wrote:

Hi!

It's not real clear what you want.

If you want a date that is always the Sunday of that week:

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

Biff

"Dm76" wrote in message
...
I would like to have an auto updating date for a timesheet. At the start of
the week the date would show the date at the end of the week. At the start
of
each week the date would change to the end date of that week.




  #4   Report Post  
Biff
 
Posts: n/a
Default

Instead of a formula you need an event macro. I can't help you with that.

Maybe someone will follow-up with a macro or you can post this in the
programming forum.

Biff

"Dm76" wrote in message
...
Thanks that worked well. Is it possible to have the function only update
when
the file is saved and not at any other time. e.g. when opened or data
changed
in the cell?

"Biff" wrote:

Hi!

It's not real clear what you want.

If you want a date that is always the Sunday of that week:

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

Biff

"Dm76" wrote in message
...
I would like to have an auto updating date for a timesheet. At the start
of
the week the date would show the date at the end of the week. At the
start
of
each week the date would change to the end date of that week.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stuart Peters
 
Posts: n/a
Default auto working week-ending date for timesheet

Here is what I do in VBA my date field is S2 (2,19) and my week ends on
Saturday

Private Sub Workbook_Open()
' Unprotect protected cells to add user name
Worksheets("Time Report").Unprotect (UserInterfaceOnly)
'Get User name
Worksheets("Time Report").Cells(2, 3) = Worksheets("Time
Report").Application.UserName
If 7 - Weekday(Date, vbSunday) + Date < Sheet2.Cells(2, 19).Value Then
If MsgBox("Week Ending: " + Str(Worksheets("Time Report").Cells(2,
19).Value) + _
" Is not this week, Do you want to start a new week?", vbYesNo Or
vbQuestion, "Start a New Week?") = vbYes Then
Worksheets("Time Report").Cells(2, 19) = 7 - Weekday(Date,
vbSunday) + Date
bNew = True
End If
End If
If bNew Then
fname = "CSTS " & Str(Worksheets("Time Report").Cells(2, 19).Value2)
& " " & _
Worksheets("Time Report").Application.UserName
ThisWorkbook.SaveAs Filename:=fname
End If
bNew = False
' Protect worksheet again
Worksheets("Time Report").Protect (UserInterfaceOnly)
End Sub


"Dm76" wrote:

Thanks that worked well. Is it possible to have the function only update when
the file is saved and not at any other time. e.g. when opened or data changed
in the cell?

"Biff" wrote:

Hi!

It's not real clear what you want.

If you want a date that is always the Sunday of that week:

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

Biff

"Dm76" wrote in message
...
I would like to have an auto updating date for a timesheet. At the start of
the week the date would show the date at the end of the week. At the start
of
each week the date would change to the end date of that week.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
search for latest date Sue Excel Worksheet Functions 2 August 2nd 05 11:09 PM
Date, Day of week andrewm Excel Worksheet Functions 6 July 5th 05 09:55 PM
assign auto number and auto date Krit Kasem Excel Discussion (Misc queries) 2 January 14th 05 02:55 AM
excel links update not working in auto, calculations in auto Mikey Boy Excel Worksheet Functions 0 December 7th 04 11:53 PM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"