View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default dates inside macro - help pls

These formulas will work. I think it is bettter in formulas than as a macro

F2 : =IF(NOW()-DATEVALUE("3/3/08")5,DATEVALUE("3/3/08")5,"Monday")
G2 : =IF(NOW()-DATEVALUE("3/4/08")5,DATEVALUE("3/3/08")4,"Tuesday")
H2 : =IF(NOW()-DATEVALUE("3/5/08")5,DATEVALUE("3/3/08")3,"Wednesday")
I2 : =IF(NOW()-DATEVALUE("3/6/08")5,DATEVALUE("3/3/08")2,"Thursday")
J2 : =IF(NOW()-DATEVALUE("3/7/08")5,DATEVALUE("3/3/08")1,"Friday")

"dee" wrote:

i am maintaiining versions of my excel sheet. for this case i need to have 5
working weekdates as 5 columns... say column F2 to J2

I want to write within a macro to display dates in such a way that when im
from 3March to 7 MArch monday to friday it should show me mon to fri and when
i go to next week and when i open this old sheet it should not show the
current dates but it shud show last week dates..

In otehr words to maintain thsi versioning weekly, i need teh dates to be
static for taht week and when i open the new dates it shud show me
appropriate from mon to fri..
please help. I tried formulas,... but since this is an automation tool i
need to write within a macro