Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Friday of a given week
Sub AddFridays()
RowNum = 1 MyYear = 2009 NewYears = DateSerial(MyYear, 1, 1) LastCol = Cells(1, Columns.Count).End(xlToLeft).Column DayofWeek = Weekday(NewYears, vbFriday) FirstFriday = NewYears + ((8 - DayofWeek) Mod 7) 'add new row Rows(RowNum).Insert For ColCount = 1 To LastCol WeekNum = Cells(RowNum + 1, ColCount) FridayofWeek = FirstFriday + (7 * (WeekNum - 1)) Cells(RowNum, ColCount) = Format(FridayofWeek, "yyyy-mmm-dd") Next ColCount End Sub "QB" wrote: I have a row with week numbers and would like to insert a row above it which list the Friday of that week number. How can I do this? Week 19 would give 2009-May-08 (yyyy-mmm-dd) Thank you QB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
6 Day working week (friday holiday) | Excel Worksheet Functions | |||
Friday of a given week | Excel Programming | |||
Friday date of next week.. | Excel Discussion (Misc queries) | |||
Week Ended Friday | Excel Worksheet Functions | |||
Finding Friday in week number | New Users to Excel |