Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
How do i say within a macro taht my dates for a workweek should be static.
like 03/Mar to 7/Mar should remain static for thsi week and when i m in next week when i open this same sheet it shud give me last week's dates only..(this is to maintain versions) but the date has to be dynamic. taht is when i run a macro, when im in a currenty week it shud show me the current week's 5 days only.... as 5 columns. but when i open the version of teh sheet that i opened l;ast week it shud give me last weeks dates only |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dim StartDate As Date
Dim EndDate As Date StartDate = Date - Weekday(Date, 2) + 1 EndDate = StartDate + 4 -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dee" wrote in message ... How do i say within a macro taht my dates for a workweek should be static. like 03/Mar to 7/Mar should remain static for thsi week and when i m in next week when i open this same sheet it shud give me last week's dates only..(this is to maintain versions) but the date has to be dynamic. taht is when i run a macro, when im in a currenty week it shud show me the current week's 5 days only.... as 5 columns. but when i open the version of teh sheet that i opened l;ast week it shud give me last weeks dates only |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
But how do i writ e ths peice of code so taht my column F2 to J2 get filled
with dates "Bob Phillips" wrote: Dim StartDate As Date Dim EndDate As Date StartDate = Date - Weekday(Date, 2) + 1 EndDate = StartDate + 4 -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dee" wrote in message ... How do i say within a macro taht my dates for a workweek should be static. like 03/Mar to 7/Mar should remain static for thsi week and when i m in next week when i open this same sheet it shud give me last week's dates only..(this is to maintain versions) but the date has to be dynamic. taht is when i run a macro, when im in a currenty week it shud show me the current week's 5 days only.... as 5 columns. but when i open the version of teh sheet that i opened l;ast week it shud give me last weeks dates only |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dim StartDate As Date
Dim EndDate As Date StartDate = Date - Weekday(Date, 2) + 1 EndDate = StartDate + 4 For i = StartDate To EndDate Cells(2, i+5).Value = i Cells(2, i+5).Numberformat = "dd/mm/yyyy" Next i -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dee" wrote in message ... But how do i writ e ths peice of code so taht my column F2 to J2 get filled with dates "Bob Phillips" wrote: Dim StartDate As Date Dim EndDate As Date StartDate = Date - Weekday(Date, 2) + 1 EndDate = StartDate + 4 -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "dee" wrote in message ... How do i say within a macro taht my dates for a workweek should be static. like 03/Mar to 7/Mar should remain static for thsi week and when i m in next week when i open this same sheet it shud give me last week's dates only..(this is to maintain versions) but the date has to be dynamic. taht is when i run a macro, when im in a currenty week it shud show me the current week's 5 days only.... as 5 columns. but when i open the version of teh sheet that i opened l;ast week it shud give me last weeks dates only |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
CSE Formula Prob | Excel Worksheet Functions | |||
vlookup prob with all #n/a's | Excel Discussion (Misc queries) | |||
Macro Prob | Excel Worksheet Functions | |||
Counting prob | Excel Discussion (Misc queries) | |||
A little help, prob simple to anyone else | New Users to Excel |