LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get Date today from WeekEnding

I managed to sort it out myself.

I removed the code from the "Worksheet Open" Activate event and move
it into a Module and made a call to the Module on opening th
worksheet.

Used this code:

Dim dt As Date

' If day = Monday
If Weekday(Date, vbSunday) = 2 Then
dt = Date + 4
dWeekEnding = Format(dt, "dd.mm.yyyy")
End If
Day1Date = Format(dt - 4, "dd.mm.yyyy")
Day2Date = Format(dt - 3, "dd.mm.yyyy")
Day3Date = Format(dt - 2, "dd.mm.yyyy")
Day4Date = Format(dt - 1, "dd.mm.yyyy")
Day5Date = dWeekEnding

Not pretty and probably bad programming coz i guess i could have used
For - Next loop, but still, it does the job

--
Message posted from http://www.ExcelForum.com

 
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
change date in excel from today to original date of file Nelson Excel Discussion (Misc queries) 1 September 18th 09 08:33 AM
Weekending Date w/Less Than 3 days Assoc. with Prior Month MoneyMan Excel Worksheet Functions 7 September 14th 09 06:45 PM
Rounding Dates to Weekending Date Neil Pearce Excel Discussion (Misc queries) 2 September 2nd 09 04:24 PM
IF TODAY equals date in cell A10, or if TODAY is beyond that date SoupNazi Excel Worksheet Functions 4 April 23rd 07 01:14 AM
Weekending date issue mgkaam Excel Discussion (Misc queries) 1 January 31st 07 06:46 AM


All times are GMT +1. The time now is 10:16 PM.

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

About Us

"It's about Microsoft Excel"